Download the latest sdk
Briefly describe the Weibo login process and precautions.
1. Introduction
AppKey
The App Key assigned to each third-party application. Used for authentication, source display, and other functions.
RedirectURI
Third-party application authorization callback page. The authorization callback page is invisible to users for mobile client applications, so the definition of the form will not affect, but the definition will not be able to use SDK authentication for logon. We recommend that you use the default callback page https://api.weibo.com/oauth2/default.html
You can find it on the "Sina Weibo Open Platform"> "My applications"> "application information"> "Advanced Applications"> "Authorization Settings"> "application callback" page.
Scope
Scope is a function provided by the authorization page of the new version of OAuth2.0. Through scope, the platform will open more core Weibo functions
It also enhances user privacy protection and enhances user experience. Users have the right to choose to grant permissions on the new OAuth2.0 authorization page.
Application features.
The AccessToken indicates the T oken of the user identity, which is used to call the Weibo OpenAPI.
Expire in Token expiration time, used to determine whether the logon has expired.
Oauth2.0 Web authorization uses WebView for authorization and returns Token information.
SSO authorization calls the Weibo client for authorization and returns the Token information.
2. Preparations
Register your application on the Weibo open platform, obtain the APP_KEY, and add the application's authorization callback page (Redirect
(URI). Only after the application package name and signature are registered on the Weibo open platform can authorization be performed correctly.
3. Integration Method
Before integrating the Weibo SDK, You can integrate the Weibo SDK in either of the following ways:
Export direct import weibosdkcore. jar: Applicable to projects that only require Weibo authorization and sharing
Consumer references WeiboSDK Project (Library): Applicable to Weibo authorization, sharing, and projects that require login buttons and OpenAPI calls.
4. authentication and authorization
Weibo SDK currently provides two authorization Methods: Web authorization through WebView And SSO through Weibo client.
Authorization. (If you log on to the sso client, you are advised to upgrade the client to the latest version.) For detailed steps, see the official documentation.
5. Share Weibo
Third-party applications can share text, images, videos, music, and other content. Currently, there are two ways to share.
TIPS: Use a third-party application to arouse Weibo clients for sharing (the sharing method is usually used by a third-party client)
Third-party applications can be shared through the Weibo client (cooperative access is required for this sharing method)
6. If you cannot log on, check whether the configuration items in the Weibo account are missing. Pay attention to entering the test account.
If you have any questions, please leave a message. If you reprint it, please indicate the source.