Skip to content

nt-devilboi/EasyOAuth2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyOAuth2.0

EasyOAuth2.0 Help you Get Token From others Authorization Services like: GitHub, Google.

Getting started

First Create OAuthConstructor

var oAuths = OAuths.CreateBuilder();

and

Second Add OAuths

oAuths.AddOAuth("GitHub", _ =>
{
    _.SetUriPageAuth("login/oauth/authorize")
        .SetUriGetAccessToken("login/oauth/access_token")
        .SetHostServiceOAuth("https://github.com")
        .ConfigureApp()
        .SetRedirectUrl("YourUrl")
        .SetClientSecret("YourClientSecret")
        .SetClientId("YourClientId");
});

Third Add in Di (for asp.net)

builder.Services.AddSingleton<IOAuthService, OAuthService>();
builder.Services.AddOAuths(oAuths);

Fourth create request on Auth server

OAuthService.CreateOAuthRequests(yourState);

Fifth Get Token

var token = await _OAuthService.GetAccessToken(yourState, AuthServiceCode);

About

Libs for easy use Protocol OAuth2.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages