CarpaNet.OAuth is an OAuth library for CarpaNet.
This library is experimental and not stable. Expect issues and bugs!
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
