Skip to main content
Module

x/minecraft_lib/auth/mod.ts>OAuthClient

A collection of modules that can be used to build Minecraft servers, clients, utilities and other tools.
Latest
class OAuthClient
Re-export
import { OAuthClient } from "https://deno.land/x/minecraft_lib@0.1.0/auth/mod.ts";

A simple OAuth client that supports public clients (without client secret).

Constructors

new
OAuthClient(options: OAuthClientConfig)

Properties

readonly
redirectUri: string

Methods

Builds the URI to which the user will be redirected to perform the authorization.

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.