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

x/oauth2_server/resource_server.ts

A standards compliant implementation of an OAuth 2.0 authorization server with PKCE support.
Latest
import * as oauth2Server from "https://deno.land/x/oauth2_server@0.12.0/resource_server.ts";

Classes

The resource owner or authorization server denied the request.

Client authentication failed.

The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.

The request is missing a required parameter, includes an unsupported parameter value, repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed.

The requested scope is invalid, unknown, or malformed.

A basic implementation of scope.

The authorization server encountered an unexpected condition that prevented it from fulfilling the request.

The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.

The authenticated client is not authorized to use this authorization grant type.

The authorization grant type is not supported by the authorization server.

The authorization server does not support obtaining an authorization code using this method.

The token type is not supported by the authorization server.

Variables

The default allowed PKCE code challenge methods. Clients SHOULD use PKCE code challenge methods that do not expose the PKCE verifier in the authorization request. Currently, "S256" is the only such method. https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics#section-2.1.1

Functions

Gets the authorize parameters from the request.

Generates url for an authorization get request.

Generates a random code verifier with a minimum of 256 bits of entropy. This is done by generating a random 32-octet sequence then base64url encoding it to produce a 43 octet URL safe string. https://datatracker.ietf.org/doc/html/rfc7636#section-7.1

Generates random salt. The length is the number of bytes.

Hashes a password with salt using the PBKDF2 algorithm with 100k SHA-256 iterations.

Used for redirecting to login page for the authorization code flow.

Type Aliases

A challenge method used for PKCE. Transforms a verifier into a challenge.