Baidu OAuth2.0 logon and oauth2.0 Logon
Description:
This document is developed in C #. The MVC Framework calls the Baidu Third-Party logon OAuth2.0 interface.
Detailed steps:
1.Account
Http://developer.baidu.com/
Personal Baidu account, login Baidu development platform http://developer.baidu.com /.
If not registered:
Https://passport.baidu.com/v2? Reg & tpl = newdev & overseas = 1 & u = http://developer.baidu.com/
2.Application
Http://developer.baidu.com/console#app/project
Create an application
3.Application authorization callback
Http://developer.baidu.com/console#manage/safe! Appid = 1, 10074074
4.Interface list
Http://developer.baidu.com/wiki/index.php? Title = docs/oauth
Interface1: Http://openapi.baidu.com/oauth/2.0/authorize
Example: http://openapi.baidu.com/oauth/2.0/authorize
Parameter description:
Client_id:The AppKey allocated when the string application is applied.
Redirect_uri:The URI to be called back after string Authorization, that is, the URI that receives the Authorization Code.
Response_type:The default code of the string response.
Interface2:Https://openapi.baidu.com/oauth/2.0/token
Example: https://openapi.baidu.com/oauth/2.0/token
Other interfaces are called by yourself:
For example, you need to use
Https://openapi.baidu.com/rest/2.0/passport/users/getInfo
Interface to obtain user information and store the database.
5.Help class development
HttpHelp: http-GET/POST access interface
CommonHelp: Convert json to object
6.Entity List
You can create an object based on json data returned by calling the interface.
Entity1:AccessToken entity
7.Business logic development
The server background get or foreground a tag initiates the authentication request:
Enter the account information to log on.
Returned by authenticated LoginCodeObtainAccess_token
Now the processing is complete. Specific CodeDemoCase.
8.Demo address
Http://download.csdn.net/download/chengtianfei666/9957652