Baidu oauth2.0 WEB Link

Source: Internet
Author: User
Tags oauth

Source:http://developer.baidu.com/wiki/index.php?title=docs/oauth/authorization

Webpage

Function:authorization Code

Url:http://openapi.baidu.com/oauth/2.0/authorize

Parameters:

1.client_id

2.response_type "Code"

3.redirect_uri if success, then page turn back to this page; (if user cancel the authorization Midway, a string "error= Access_denied "would follow this URI);

4.Display I choose "Page"

Example:

Http://openapi.baidu.com/oauth/2.0/authorize?

Response_type=code

&client_id=yrlmicbrv56ccjfmws21dkqp

&redirect_uri=http%3a%2f%2fwww.lecai.com%2fuser%2fbaidu%2fcallback%2f%3freferer%3dhttp%253a%252f% 252fwww.lecai.com%252f%253fagentid%253d4200

&scope=super_msg

&display=page

After then, Baidu authorization sever build a authorization code and attach it to the Redirect_uri given in parameter be Fore. This just looks like:

Location:http://www.example.com/oauth_redirect?code=anxxsnjwqdugonqeikrmu2bkaxcdllxn

Attention:

The validity of each Authorization Code for ten minutes, and can only be used once.

Function:via Authorization Code get access token

Url:https://openapi.baidu.com/oauth/2.0/token

Parameters:

1.grant_type: "Authorization_code"

2.code:value of Authorization_code

3.client_id:api Key of app (it seems like I has no app)

4.client_secret:secret Key of App ((*_*))

5.redirect_uri:same as Redirect_uri given before

Example:

Https://openapi.baidu.com/oauth/2.0/token?

grant_type=authorization_code&

code=anxxsnjwqdugonqeikrmu2bkaxcdllxn&

client_id=va5yqrhla4fq4er3lt0vuxv4&

client_secret=0rdsjzq20xuj5itv7wrtznpqszr5pvw2&

Redirect_uri=http%3a%2f%2fwww.example.com%2foauth_redirect

+-----------------------------+-----------------+

For Mobile:

Example:

Http://openapi.baidu.com/oauth/2.0/authorize?

display=mobile&

client_id=yrlmicbrv56ccjfmws21dkqp&

response_type=code&

redirect_uri=http%3a%2f%2fh.lecai.com%2fapi%2fcooperator%2fbaidu%2flogin%2fcallback%3freferer% 3dlynwyxropxbhz2uvbwfpbg%25253d%25253d

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.