WeiboOAuth2.Provider 1.0.1

There is a newer version of this package available.
See the version list below for details.
Install-Package WeiboOAuth2.Provider -Version 1.0.1
dotnet add package WeiboOAuth2.Provider --version 1.0.1
<PackageReference Include="WeiboOAuth2.Provider" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WeiboOAuth2.Provider --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WeiboOAuth2.Provider, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install WeiboOAuth2.Provider as a Cake Addin
#addin nuget:?package=WeiboOAuth2.Provider&version=1.0.1

// Install WeiboOAuth2.Provider as a Cake Tool
#tool nuget:?package=WeiboOAuth2.Provider&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


Weibo OAuth 2.0 provider for .net core 2.0

github :

nuget(current version) :


2017.10.02 : change the main namespace to "WeiboOAuth2.Provider", not "WeiboOAuth2.Provider.Src" .

Weibo OAuth 2.0

[T]: Implemented
[F]: Not implemented

OAuth2(Guider)VERSION 1.0.0
[T]Request authorization:	oauth2/authorize	
[T]Get authorization:	oauth2/access_token	
[F]Authorization Query:	oauth2/get_token_info	
[F]Replace authorization:	oauth2/get_oauth2_token	
[T]Authorization Recycle:	oauth2/revokeoauth2	
Other interfaces:	
  [F]account/rate_limit_status	Gets the current authorized user API Access frequency limit
  [F]account/get_uid	        To obtain a user's UID after authorization
  [F]account/profile/email	        Get user's contact mailbox after authorization
  [T]      get user infos

Package Manager

PM > Install-Package WeiboOAuth2.Provider -Version 1.0.0


> dotnet add package WeiboOAuth2.Provider --version 1.0.0

Dependencies :

.NETStandard 2.0

Newtonsoft.Json (>= 10.0.3)

How to use:

1. Create options for WeiboOAuth2.0 and inject it into container

    public class WeiboOAuthV2Option : IWeiboOAuthV2Option {
        public string AppID => "your app id";
        public string AppSecret => "your app secret";

    // ...... then inject it.

    services.AddScoped<IWeiboOAuthV2Option, WeiboOAuthV2Option>();

2. Then create your service

    // new interface for web service provider
    public interface IWeiboOAuthService<TUser> : IWeiboOAuthV2Provider<WeiboSuccessToken, WeiboUser> {
        // add your code here.

    public class WeiboOAuthService : WeiboOAuthV2Provider, IWeiboOAuthService<User> {

        private YourDBContext db;

        public WeiboOAuthService(YourDBContext db, IWeiboOAuthV2Option options) : base(options) {
            this.options = options;
            this.db = db;


    // then inject it

    services.AddScoped<IWeiboOAuthService<User>, WeiboOAuthService>();

3. Use in controller

public class IdentityController : Controller {

        private YourDBContext db;
        private IWeiboOAuthService<User> weibo;

        public IdentityController(YourDBContext db, IWeiboOAuthService<User> WEOBO_SRV) {
            this.db = db;

4. Request authorization (frontend)

// example in typescript
public get WeiboAuth() {
    // my regex tools : ws-regex (npm)
    const href = Regex.Create(/htt.+\/\/.+?\//).Matches(window.location.href)[0];
    return `${this.server.WeiboOAuthHost}/authorize?client_id=${this.server.WeiboClientID}&response_type=code&redirect_uri=${href}`;

5. Get authorization

 var (result, succeed, error) = await, redirect_url);

6. Get userinfos

var (infos, succeed02, error02) = await, result.AccessToken);

7. Authorization Recycle

var (result, succeed, error) = await;

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 947 10/2/2017
1.0.1 586 10/2/2017
1.0.0 601 10/1/2017

2017.10.02 :
1. change the main namespace to "WeiboOAuth2.Provider", not "WeiboOAuth2.Provider.Src";
2. add document for some methods and fields;
3. add tests.