import { OAuthClient } from "https://deno.land/x/minecraft_lib@0.1.0/auth/oauth.ts";
A simple OAuth client that supports public clients (without client secret).
Constructors
new
OAuthClient(options: OAuthClientConfig)Methods
buildAuthorizationUri(): string
Builds the URI to which the user will be redirected to perform the authorization.
parseAuthorizationResponse(uri: string): AuthorizationResponse | null
Parses and validates the authorization response URI, and returns the authorization code.
Returns null
, if the URI doesn't match the specified redirect URI.
refreshAccessToken(refreshToken: string): Promise<OAuthToken>
Refreshes an access token using the refresh token.
requestAccessToken(code: string): Promise<OAuthToken>
Requests an access token using the authorization code.
requestDeviceAccessToken(deviceCode: string): Promise<OAuthToken | null>
Requests an access token using a given device code.
Returns null
, if the authorization is pending.
Initiates the authorization code flow.