


"PHP Third-Party Login—OAuth2.0 Protocol Video Tutorial" mainly introduces the third-party login related protocol—OAuth2.0 protocol. It mainly introduces the usage scenarios and implementation principles of OAuth, and explains the precautions for using the OAuth2.0 protocol based on actual practice, which is of great practical value.
Course playback address: http://www.php.cn/course/410.html
The teacher’s teaching style:
The teacher’s lectures are vivid, witty, witty, and touching. A vivid metaphor is like the finishing touch, opening the door to wisdom for students; an appropriate humor brings a knowing smile to students, like drinking a glass of mellow wine, giving people aftertaste and nostalgia; a philosopher's aphorisms, cultural references Proverbs are interspersed from time to time in the narration, giving people thinking and warning.
The more difficult point in this video is the detailed explanation of the OAuth authorization process:
What is OAuth authorization?
1. What is the OAuth protocol
OAuth (Open Authorization) is an open standard. The so-called OAuth (Open Authorization, Open Authorization) provides a security for user resource authorization. Simple standard,
allows third-party websites to access various information stored by users in service providers under the premise of user authorization.
This kind of authorization does not require the user to provide the user name and password to the third-party website but to log in directly from the page provided by the service provider.
OAuth allows users to provide an access token (professional point is called a token) to a third-party website. An access token (professional point is called a token) corresponds to a specific third-party website. At the same time, the access token (professional point is called a token) It’s called a token) and can only access specific resources within a specific time.
To put it bluntly: that is to say, when a user accesses a third-party web or application, the third party does not know the user’s account and password. In this case, after authorization by the user, you can obtain the articles, Weibo information and other information stored by the user on the service provider
1. OAuth authorization must go through three steps
The first step: Obtain the unauthorized Request Token (request token) Jump to the service provider's login page
The second step: Obtain the user authorization Request Token (request token) The user enters the account password for login authorization
Step 3: Exchange the authorized Request Token (request token) for Access Token (access token)
The above three steps are necessary steps for OAuth authorization. Many companies may have different authorization methods. There are differences, but the general steps are the same
The following uses Sina Weibo as an example to introduce how to perform OAuth authorization:
1. First you need to be Sina developers click here to enter the developer website: http://open.weibo.com
After entering, register an account and add developer personal information. You can log in directly with your Weibo account and join the development The detailed steps will not be repeated here
2. Create an application. How to create an application, just click My Application on the top navigation bar to create it
*Assume that you Add "Program Source Weibo" to the name of the created application
*After the application is created, it will enter the "Development Phase" by default and it will be eligible for authorization
*At this time, click My Application--> ; Application information you will see the following information
The above is the detailed content of PHP third-party login OAuth2.0 protocol video tutorial resource introduction. For more information, please follow other related articles on the PHP Chinese website!

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

实现方法:1、使用“sleep(延迟秒数)”语句,可延迟执行函数若干秒;2、使用“time_nanosleep(延迟秒数,延迟纳秒数)”语句,可延迟执行函数若干秒和纳秒;3、使用“time_sleep_until(time()+7)”语句。

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

php字符串有下标。在PHP中,下标不仅可以应用于数组和对象,还可应用于字符串,利用字符串的下标和中括号“[]”可以访问指定索引位置的字符,并对该字符进行读写,语法“字符串名[下标值]”;字符串的下标值(索引值)只能是整数类型,起始值为0。

方法:1、用“str_replace(" ","其他字符",$str)”语句,可将nbsp符替换为其他字符;2、用“preg_replace("/(\s|\ \;||\xc2\xa0)/","其他字符",$str)”语句。

在php中,可以使用substr()函数来读取字符串后几个字符,只需要将该函数的第二个参数设置为负值,第三个参数省略即可;语法为“substr(字符串,-n)”,表示读取从字符串结尾处向前数第n个字符开始,直到字符串结尾的全部字符。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
