import { ResourceServer } from "https://deno.land/x/oauth2_server@0.12.0/resource_server.ts";
Constructors
new
ResourceServer(options: ResourceServerOptions<Client, User, Scope>)Methods
authenticate<Request extends OAuth2Request<Client, User, Scope>>(): Promise<void>
request: Request,
response: OAuth2Response,
next: () => Promise<unknown>,
getAccessToken: (request: Request) => Promise<string | null>,
acceptedScope?: Scope,
Authenticates a request and verifies the token has the required scope.
authenticateError(): Promise<void>
Handles the response for an unauthenticated request.
authenticateResponse(request: OAuth2Request<Client, User, Scope>, response: OAuth2Response): Promise<void>
Adds authentication scope headers to the response.
authenticateSuccess(): Promise<void>
request: OAuth2AuthenticatedRequest<Client, User, Scope>,
response: OAuth2Response,
next: () => Promise<unknown>,
Handles the response for an authenticated request.
errorHandler(): Promise<void>
Handles error responses.
getAccessToken(request: OAuth2Request<Client, User, Scope>): Promise<string | null>
Gets an access token string from the authorization header or post body.
Gets a token for an access token string.