Skip to content
Esc
navigateopen⌘Jpreview
Dashboard
On this page

supertokens-node/recipe/oauth2provider

References documentation for the supertokens-node/recipe/oauth2provider package

Classes

default

Defined in: recipe/oauth2provider/index.ts

Constructors

Constructor
new default(): default;
Returns

default

Properties

Property Modifier Type Default value Defined in
init static (config?) => RecipeListFunction Recipe.init recipe/oauth2provider/index.ts

Methods

createOAuth2Client()
static createOAuth2Client(input, userContext?): Promise<
  | {
  client: OAuth2Client;
  status: "OK";
}
  | {
  error: string;
  errorDescription: string;
  status: "ERROR";
}>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
input CreateOAuth2ClientInput
userContext? Record<string, any>
Returns

Promise< | { client: OAuth2Client; status: "OK"; } | { error: string; errorDescription: string; status: "ERROR"; }>

createTokenForClientCredentials()
static createTokenForClientCredentials(
   clientId, 
   clientSecret, 
   scope?, 
   audience?, 
   userContext?): Promise<
  | ErrorOAuth2
| TokenInfo>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
clientId string
clientSecret string
scope? string[]
audience? string
userContext? Record<string, any>
Returns

Promise< | ErrorOAuth2 | TokenInfo>

deleteOAuth2Client()
static deleteOAuth2Client(input, userContext?): Promise<
  | {
  status: "OK";
}
  | {
  error: string;
  errorDescription: string;
  status: "ERROR";
}>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
input DeleteOAuth2ClientInput
userContext? Record<string, any>
Returns

Promise< | { status: "OK"; } | { error: string; errorDescription: string; status: "ERROR"; }>

getOAuth2Client()
static getOAuth2Client(clientId, userContext?): Promise<
  | {
  client: OAuth2Client;
  status: "OK";
}
  | {
  error: string;
  errorDescription: string;
  status: "ERROR";
}>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
clientId string
userContext? Record<string, any>
Returns

Promise< | { client: OAuth2Client; status: "OK"; } | { error: string; errorDescription: string; status: "ERROR"; }>

getOAuth2Clients()
static getOAuth2Clients(input, userContext?): Promise<
  | {
  clients: OAuth2Client[];
  nextPaginationToken?: string;
  status: "OK";
}
  | {
  error: string;
  errorDescription: string;
  status: "ERROR";
}>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
input GetOAuth2ClientsInput
userContext? Record<string, any>
Returns

Promise< | { clients: OAuth2Client[]; nextPaginationToken?: string; status: "OK"; } | { error: string; errorDescription: string; status: "ERROR"; }>

revokeToken()
static revokeToken(
   token, 
   clientId, 
   clientSecret?, 
   userContext?): Promise<
  | ErrorOAuth2
  | {
  status: "OK";
}>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
token string
clientId string
clientSecret? string
userContext? Record<string, any>
Returns

Promise< | ErrorOAuth2 | { status: "OK"; }>

revokeTokensByClientId()
static revokeTokensByClientId(clientId, userContext?): Promise<{
  status: "OK";
}>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
clientId string
userContext? Record<string, any>
Returns

Promise<{ status: "OK"; }>

revokeTokensBySessionHandle()
static revokeTokensBySessionHandle(sessionHandle, userContext?): Promise<{
  status: "OK";
}>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
sessionHandle string
userContext? Record<string, any>
Returns

Promise<{ status: "OK"; }>

updateOAuth2Client()
static updateOAuth2Client(input, userContext?): Promise<
  | {
  client: OAuth2Client;
  status: "OK";
}
  | {
  error: string;
  errorDescription: string;
  status: "ERROR";
}>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
input UpdateOAuth2ClientInput
userContext? Record<string, any>
Returns

Promise< | { client: OAuth2Client; status: "OK"; } | { error: string; errorDescription: string; status: "ERROR"; }>

validateOAuth2AccessToken()
static validateOAuth2AccessToken(
   token, 
   requirements?, 
   checkDatabase?, 
   userContext?): Promise<{
  payload: JSONObject;
  status: "OK";
}>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
token string
requirements? { audience?: string; clientId?: string; scopes?: string[]; }
requirements.audience? string
requirements.clientId? string
requirements.scopes? string[]
checkDatabase? boolean
userContext? Record<string, any>
Returns

Promise<{ payload: JSONObject; status: "OK"; }>

validateOAuth2RefreshToken()
static validateOAuth2RefreshToken(
   token, 
   scopes?, 
   userContext?): Promise<
  | InstrospectTokenResponse & { status: "OK"; }
| ErrorOAuth2>;

Defined in: recipe/oauth2provider/index.ts

Parameters
Parameter Type
token string
scopes? string[]
userContext? Record<string, any>
Returns

Promise< | InstrospectTokenResponse & { status: “OK”; } | ErrorOAuth2>

Variables

createOAuth2Client()

createOAuth2Client: (input, userContext?) => Promise<
  | {
  client: OAuth2Client;
  status: "OK";
}
  | {
  error: string;
  errorDescription: string;
  status: "ERROR";
}> = Wrapper.createOAuth2Client;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
input CreateOAuth2ClientInput
userContext? Record<string, any>

Returns

Promise< | { client: OAuth2Client; status: "OK"; } | { error: string; errorDescription: string; status: "ERROR"; }>


createTokenForClientCredentials()

createTokenForClientCredentials: (clientId, clientSecret, scope?, audience?, userContext?) => Promise<
  | ErrorOAuth2
  | TokenInfo> = Wrapper.createTokenForClientCredentials;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
clientId string
clientSecret string
scope? string[]
audience? string
userContext? Record<string, any>

Returns

Promise< | ErrorOAuth2 | TokenInfo>


deleteOAuth2Client()

deleteOAuth2Client: (input, userContext?) => Promise<
  | {
  status: "OK";
}
  | {
  error: string;
  errorDescription: string;
  status: "ERROR";
}> = Wrapper.deleteOAuth2Client;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
input DeleteOAuth2ClientInput
userContext? Record<string, any>

Returns

Promise< | { status: "OK"; } | { error: string; errorDescription: string; status: "ERROR"; }>


getOAuth2Client()

getOAuth2Client: (clientId, userContext?) => Promise<
  | {
  client: OAuth2Client;
  status: "OK";
}
  | {
  error: string;
  errorDescription: string;
  status: "ERROR";
}> = Wrapper.getOAuth2Client;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
clientId string
userContext? Record<string, any>

Returns

Promise< | { client: OAuth2Client; status: "OK"; } | { error: string; errorDescription: string; status: "ERROR"; }>


getOAuth2Clients()

getOAuth2Clients: (input, userContext?) => Promise<
  | {
  clients: OAuth2Client[];
  nextPaginationToken?: string;
  status: "OK";
}
  | {
  error: string;
  errorDescription: string;
  status: "ERROR";
}> = Wrapper.getOAuth2Clients;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
input GetOAuth2ClientsInput
userContext? Record<string, any>

Returns

Promise< | { clients: OAuth2Client[]; nextPaginationToken?: string; status: "OK"; } | { error: string; errorDescription: string; status: "ERROR"; }>


init()

init: (config?) => RecipeListFunction = Wrapper.init;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
config? TypeInput

Returns

RecipeListFunction


revokeToken()

revokeToken: (token, clientId, clientSecret?, userContext?) => Promise<
  | ErrorOAuth2
  | {
  status: "OK";
}> = Wrapper.revokeToken;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
token string
clientId string
clientSecret? string
userContext? Record<string, any>

Returns

Promise< | ErrorOAuth2 | { status: "OK"; }>


revokeTokensByClientId()

revokeTokensByClientId: (clientId, userContext?) => Promise<{
  status: "OK";
}> = Wrapper.revokeTokensByClientId;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
clientId string
userContext? Record<string, any>

Returns

Promise<{ status: "OK"; }>


revokeTokensBySessionHandle()

revokeTokensBySessionHandle: (sessionHandle, userContext?) => Promise<{
  status: "OK";
}> = Wrapper.revokeTokensBySessionHandle;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
sessionHandle string
userContext? Record<string, any>

Returns

Promise<{ status: "OK"; }>


updateOAuth2Client()

updateOAuth2Client: (input, userContext?) => Promise<
  | {
  client: OAuth2Client;
  status: "OK";
}
  | {
  error: string;
  errorDescription: string;
  status: "ERROR";
}> = Wrapper.updateOAuth2Client;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
input UpdateOAuth2ClientInput
userContext? Record<string, any>

Returns

Promise< | { client: OAuth2Client; status: "OK"; } | { error: string; errorDescription: string; status: "ERROR"; }>


validateOAuth2AccessToken()

validateOAuth2AccessToken: (token, requirements?, checkDatabase?, userContext?) => Promise<{
  payload: JSONObject;
  status: "OK";
}> = Wrapper.validateOAuth2AccessToken;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
token string
requirements? { audience?: string; clientId?: string; scopes?: string[]; }
requirements.audience? string
requirements.clientId? string
requirements.scopes? string[]
checkDatabase? boolean
userContext? Record<string, any>

Returns

Promise<{ payload: JSONObject; status: "OK"; }>


validateOAuth2RefreshToken()

validateOAuth2RefreshToken: (token, scopes?, userContext?) => Promise<
  | InstrospectTokenResponse & { status: "OK"; }
  | ErrorOAuth2> = Wrapper.validateOAuth2RefreshToken;

Defined in: recipe/oauth2provider/index.ts

Parameters

Parameter Type
token string
scopes? string[]
userContext? Record<string, any>

Returns

Promise< | InstrospectTokenResponse & { status: “OK”; } | ErrorOAuth2>

References

APIInterface

Re-exports APIInterface


APIOptions

Re-exports APIOptions


RecipeInterface

Re-exports RecipeInterface

API reference

API schema and response details