Website Login using github
New OAuth in the github
github OAuth official documents
- Application name Application name
- Homepage URL request address your application
- Application description describe your application
- Authorization callback URL after successful authentication redirection address
After successful registration will generate a Client ID, Client Secret will be used later
Certification process
- Send a get request
https://github.com/login/oauth/authorize
Bring Client ID
<a href="https://github.com/login/oauth/authorize?client_id=xxxxxxxxxxx"
>Sign in</a>
After confirming login, back to return to this address Authorization callback URL and carries a parameter code
- Get token
sending request tape post
client_id, code, client_secret
https://github.com/login/oauth/access_token
After a successful return access_token
- Obtaining user information
transmitted get request tape accss_token
https://api.github.com/user?access_token=xxx
After the request is successful, get back to the current user's information