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

x/oauth2_server/examples/oak-localstorage/services/token.ts>TokenService

A standards compliant implementation of an OAuth 2.0 authorization server with PKCE support.
Latest
class TokenService
import { TokenService } from "https://deno.land/x/oauth2_server@0.12.0/examples/oak-localstorage/services/token.ts";

Constructors

new
TokenService(clientService: ClientService, userService: UserService)

Properties

private
clientService: ClientService
private
userService: UserService

Methods

private
getTokenByIndex(tokenIndex: string): Promise<Token<Client, User, Scope> | undefined>
private
getTokenIndex(token: Partial<Token<Client, User, Scope>> & Pick<Token<Client, User, Scope>, "accessToken">): string | null
private
getTokenInternalByIndex(tokenIndex: string): Promise<TokenInternal>
delete(token: string | Token<Client, User, Scope> | TokenInternal): Promise<boolean>
deleteAccessToken(accessToken: string): Promise<boolean>
deleteRefreshToken(refreshToken: string): Promise<boolean>
getRefreshToken(refreshToken: string): Promise<RefreshToken<Client, User, Scope> | undefined>
getToken(accessToken: string): Promise<Token<Client, User, Scope> | undefined>
patch(token: Partial<Token<Client, User, Scope>> & Pick<Token<Client, User, Scope>, "accessToken">): Promise<void>
put(token: Token<Client, User, Scope>): Promise<void>
revoke(token: Token<Client, User, Scope>): Promise<boolean>
revoke(token: string, hint?: string | null): Promise<boolean>
revokeCode(code: string): Promise<boolean>
save(token: Token<Client, User, Scope>): Promise<Token<Client, User, Scope>>