Because the project needs, so learn the next micro-blog of the third-party authorized login, in this record, for review.
1. Developers register and refine app information
1.1 Enter http://open.weibo.com/, login with Weibo account, perfect developer information (select individual or company)
1.2 Enter http://open.weibo.com/development, click Create App, select Mobile app, perfect information (just test, some information can be filled in first, but the Android package name, and signature need to
-request authorization code (step 1 of OAuth 2.0 verification) * ResponseData-response data * ResponseStatus-response status ** note: this example uses the Weibo open platform as an example */using System; using System. net. http; using System. text. regularExpressions; using Windows. data. json; using Windows. security. authentication. web; using Windows. UI. xaml; using Windows. UI. xaml. controls; namespace Windows10.UserAndAccount {public sealed partial class OAuth20: Page {public OAuth20 ()
-in that successfully verifies the consumer, or the last plug-in that is configured with anonymous access.Note3: When using the OAuth2 plug-in with and, the OAUTH2 endpoint used to request tokens will also need to be authenticated by other configured auth plug-ins.Attention:When multiple authentication plug-ins are enabled in or on a given service and you want anonymous access to be disabled, you should con
1. Boot the user who needs authorization to the following address:Url
1
https://api.weibo.com/oauth2/authorize?client_id=YOUR_CLIENT_IDresponse_type=coderedirect_uri=YOUR_REGISTERED_REDIRECT_URI
2. If the user agrees to authorize, the page jumps to Your_registered_redirect_uri/?code=code3. In exchange for access TokenUrl
1
https://api.weibo.com/oauth2/acc
Yii\filters\auth\queryparamauth;class Bookcontroller extends activecontroller{public $modelClass = ' Frontend\models\book '; Public Function Behaviors () {$behaviors = Parent::behaviors (); $behaviors [' authenticator '] = [' class ' = = Compositeauth::classname (), ' authmethods ' = [ /* Below are three ways to verify Access_token *///1.http Basic Authentication: Access token is sent as a user name, and is applied in a scenario where access token can safely exist o
development documentation.
The procedure is as follows:
1 Step 1: The user agrees to the authorization and obtains the code2 Step 2: Exchange code for webpage authorization access_token3 Step 3: refresh access_token (if needed)4. Step 4: Pull user information (the scope must be snsapi_userinfo)5 Appendix: Check whether the authorization credential (access_token) is valid
1. On the public platform-Developer Center: webpage authorization to obtain basic user information: click "modify" to configu
services.Netflix Archaius: The Configuration Management API, which includes a series of configuration management APIs that provide dynamic typed properties, thread-safe configuration operations, polling frameworks, callback mechanisms, and more.Spring Cloud for Cloud Foundry: The OAUTH2 Protocol binding service to Cloudfoundry,cloudfoundry is the open source PAAs cloud platform that VMware has launched.Spring Cloud Sleuth: A Log collection toolkit th
, familiarize themselves with the meanings of oau2's interfaces and parameters, and then explain how to use oauth2.0.
Oau2's interface document
Interface
Description
Oau22/authorize
Request the user to authorize the token
Oau22./access_token
Obtain authorized access token
Oau22/get_token_info
Authorization information query interface
Oau22/revokeoau2
Authorization revocation Interface
Oauth1/get_oauth2_token
Change the acces
initiate the authorization page, then get the code, jump to the current page, and then request the backend to exchange the user and other related information.
Function implementation
Guides the user to call up the authorization confirmation page
Here we need to do two things: configure the jsapi domain name first, and configure the callback domain name for webpage authorization.
Build an authorized url "https://open.weixin.qq.com/connect/oauth2/autho
third-party platform after authorization.“uid”(Quotes here) with our ownuidIn order to achieve the purpose of binding, qq, unlike Weibo, returnsopenid.
Link:Http://mp.weixin.qq.com/wiki/4/9ac2e7b1f1d22e9e57260f6553822520.htmlHttp://wiki.connect.qq.com/the user openid_oauth2-0 is selected.Http://wiki.open.qq.com/wiki/api3.0documentationHttp://open.weibo.com/wiki/Oauth2/access_token
The above is my simple understanding. after all, my practical experien
Html5 + jquery get openid
Recently, I was modifying a mobile mall. Because the wap end is HTML5 and the art template technology is widely used, the modification was not suitable at the beginning, and the implementation of HTML5 using openid has never been very good, after understanding and learning the acquisition principle, we finally implemented HTML to get openid, which was slightly changed. Let's talk about it in a few minutes and do it directly:
1. Write a js file for obtaining the accessco
period (30 days). If refresh_token fails, you need to re-authorize it.
3. refresh_token Interface
Sina Weibo
Interface URL: https://api.weibo.com/oauth2/access_token
Request Method: POST
Request Parameters:
Description of required parameter types and ranges
Client_id true string the AppKey allocated when the application is applied.
Client_secret true string the AppSecret allocated when the application is applied.
Grant_type true string request type-
IOS development: Sina Weibo oau22.
Note: You must obtain user identity authentication when calling open interfaces on Weibo, such as Weibo and followers. Currently, oauth2.0. To facilitate developers to develop and test their own applications.
Compared with OAuth2.0, OAuth2.0 is simpler and safer than 1.0. It is also the most important way to authenticate and authorize users in the future.
Step 1: Create an application
Below I take this company test account as an example, the creation of applica
; [WXApi sendReq:req];}After obtaining this information, the corresponding oauthResp callback in AppDelegate will be called to obtain the code.
Step 2: token and openid
-(void)getAccess_token{ //https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPIDsecret=SECRETcode=CODEgrant_type=authorization_code NSString *url =[NSString stringWithFormat:@https://api.weixin.qq.com/sns/oauth2/access
instantiated. All these objects can modify static variables. At this time, synchronization is required.
Example 1. Weibo configuration initialization does not require synchronization
static { final String CLIENT_ID = "×××××"; final String CLIENT_SERCRET = "××××××××××××××××××"; final String BASEURL = "https://api.weibo.com/2/"; final String ACCESSTOKENURL = "https://api.weibo.com/2/oauth2/access_token"; final
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.