Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.22 KB

File metadata and controls

32 lines (23 loc) · 1.22 KB

CarpaNet.OAuth

NuGet Version License

CarpaNet Logo

CarpaNet.OAuth is an OAuth library for CarpaNet.

1444070256569233

This library is experimental and not stable. Expect issues and bugs!

OAuthSession

This is an OAuth 2.0 flow orchestrator supporting PAR (Pushed Authorization Requests), PKCE, and DPoP. Use this to produce an ATProtoOAuthClient via CallbackAsync or RestoreSessionAsync.

var config = new OAuthClientConfig
{
    ClientId = clientId,
    RedirectUri = redirectUri,
    Scope = "atproto transition:generic",
    JsonOptions = myJsonOptions,
    SessionStore = mySessionStore
};

using var oauthClient = new OAuthSession(config);
var authUrl = await oauthClient.AuthorizeAsync(handle);
// ... redirect user to authUrl, receive callback ...
var session = await oauthClient.CallbackAsync(callbackUrl);
// session implements IATProtoClient