Baidu OAuth2.0 logon and oauth2.0 Logon

Source: Internet
Author: User
Tags oauth

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

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.