Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/oauth2_server/authorization_server.ts>AuthorizationCodeServiceInterface

A standards compliant implementation of an OAuth 2.0 authorization server with PKCE support.
Latest
interface AuthorizationCodeServiceInterface
import { type AuthorizationCodeServiceInterface } from "https://deno.land/x/oauth2_server@0.12.0/authorization_server.ts";

Type Parameters

Client extends ClientInterface
User
Scope extends ScopeInterface

Properties

lifetime: number

Lifetime of authorization codes in second.

Methods

generateCode(
client: Client,
user: User,
scope?: Scope | null,
): Promise<string>

Generates an authorization code.

expiresAt(
client: Client,
user: User,
scope?: Scope | null,
): Promise<Date>

Gets the date that a new authorization code would expire at.

get(code: string): Promise<AuthorizationCode<Client, User, Scope> | void>

Retrieves an existing authorization code.

save(authorizationCode: AuthorizationCode<Client, User, Scope>): Promise<AuthorizationCode<Client, User, Scope>>

Saves an authorization code.

revoke(authorizationCode: AuthorizationCode<Client, User, Scope> | string): Promise<boolean>

Revokes an authorization code.