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

x/oauth2_server/services/authorization_code.ts>AbstractAuthorizationCodeService

A standards compliant implementation of an OAuth 2.0 authorization server with PKCE support.
Latest
class AbstractAuthorizationCodeService
Abstract
import { AbstractAuthorizationCodeService } from "https://deno.land/x/oauth2_server@0.12.0/services/authorization_code.ts";

Type Parameters

Client extends ClientInterface
User
Scope extends ScopeInterface

Properties

lifetime

Lifetime of authorization codes in second. Defaults to 5 minutes.

Methods

expiresAt(
_client: Client,
_user: User,
_scope?: Scope | null,
): Promise<Date>

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

generateCode(
_client: Client,
_user: User,
_scope?: Scope | null,
): Promise<string>

Generates an authorization code.

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

Retrieves an existing authorization code.

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

Revokes an authorization code.

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

Saves an authorization code.