Skip to main content
References

OAuth Provider Types

Type Aliases

APIInterface

type APIInterface = object;

Defined in: recipe/oauth2provider/types.ts:419

Properties

PropertyTypeDefined in
authGET| undefined | (input) => Promise< | { cookies?: string[]; redirectTo: string; } | ErrorOAuth2 | GeneralErrorResponse>recipe/oauth2provider/types.ts:430
endSessionGET| undefined | (input) => Promise< | { redirectTo: string; } | ErrorOAuth2 | GeneralErrorResponse>recipe/oauth2provider/types.ts:482
endSessionPOST| undefined | (input) => Promise< | { redirectTo: string; } | ErrorOAuth2 | GeneralErrorResponse>recipe/oauth2provider/types.ts:491
introspectTokenPOST| undefined | (input) => Promise< | InstrospectTokenResponse | GeneralErrorResponse | ErrorOAuth2>recipe/oauth2provider/types.ts:474
loginGET| undefined | (input) => Promise< | { cookies?: string[]; frontendRedirectTo: string; } | ErrorOAuth2 | GeneralErrorResponse>recipe/oauth2provider/types.ts:420
loginInfoGET| undefined | (input) => Promise< | { info: LoginInfo; status: "OK"; } | ErrorOAuth2 | GeneralErrorResponse>recipe/oauth2provider/types.ts:448
logoutPOST| undefined | (input) => Promise< | { frontendRedirectTo: string; status: "OK"; } | ErrorOAuth2 | GeneralErrorResponse>recipe/oauth2provider/types.ts:500
revokeTokenPOST| undefined | (input) => Promise< | { status: "OK"; } | ErrorOAuth2>recipe/oauth2provider/types.ts:465
tokenPOST| undefined | (input) => Promise< | TokenInfo | ErrorOAuth2 | GeneralErrorResponse>recipe/oauth2provider/types.ts:440
userInfoGET| undefined | (input) => Promise< | JSONObject | GeneralErrorResponse>recipe/oauth2provider/types.ts:455

APIOptions

type APIOptions = object;

Defined in: recipe/oauth2provider/types.ts:44

Properties

ConsentRequest

type ConsentRequest = object;

Defined in: recipe/oauth2provider/types.ts:68

Properties

CreateOAuth2ClientInput

type CreateOAuth2ClientInput = Partial<Omit<OAuth2ClientOptions, "createdAt" | "updatedAt">>;

Defined in: recipe/oauth2provider/types.ts:563

DeleteOAuth2ClientInput

type DeleteOAuth2ClientInput = object;

Defined in: recipe/oauth2provider/types.ts:575

Properties

PropertyTypeDefined in
clientIdstringrecipe/oauth2provider/types.ts:576

ErrorOAuth2

type ErrorOAuth2 = object;

Defined in: recipe/oauth2provider/types.ts:53

Properties

PropertyTypeDefined in
errorstringrecipe/oauth2provider/types.ts:58
errorDescriptionstringrecipe/oauth2provider/types.ts:61
status"ERROR"recipe/oauth2provider/types.ts:54
statusCode?numberrecipe/oauth2provider/types.ts:65

GetOAuth2ClientsInput

type GetOAuth2ClientsInput = object;

Defined in: recipe/oauth2provider/types.ts:546

Properties

PropertyTypeDescriptionDefined in
clientName?stringThe name of the clients to filter by.recipe/oauth2provider/types.ts:560
pageSize?numberItems per Page. Defaults to 250.recipe/oauth2provider/types.ts:550
paginationToken?stringNext Page Token. Defaults to "1".recipe/oauth2provider/types.ts:555

InstrospectTokenResponse

type InstrospectTokenResponse = 
| {
active: false;
}
| object & JSONObject;

Defined in: recipe/oauth2provider/types.ts:176

LoginInfo

type LoginInfo = object;

Defined in: recipe/oauth2provider/types.ts:151

Properties

LoginRequest

type LoginRequest = object;

Defined in: recipe/oauth2provider/types.ts:106

Properties

OAuth2ClientOptions

type OAuth2ClientOptions = object;

Defined in: recipe/oauth2provider/types.ts:510

Properties

PropertyTypeDefined in
audience?string[]recipe/oauth2provider/types.ts:534
authorizationCodeGrantAccessTokenLifespan?string | nullrecipe/oauth2provider/types.ts:522
authorizationCodeGrantIdTokenLifespan?string | nullrecipe/oauth2provider/types.ts:523
authorizationCodeGrantRefreshTokenLifespan?string | nullrecipe/oauth2provider/types.ts:524
clientCredentialsGrantAccessTokenLifespan?string | nullrecipe/oauth2provider/types.ts:525
clientIdstringrecipe/oauth2provider/types.ts:511
clientNamestringrecipe/oauth2provider/types.ts:516
clientSecret?stringrecipe/oauth2provider/types.ts:512
clientUri?stringrecipe/oauth2provider/types.ts:538
createdAtstringrecipe/oauth2provider/types.ts:513
enableRefreshTokenRotation?booleanrecipe/oauth2provider/types.ts:543
grantTypes?string[] | nullrecipe/oauth2provider/types.ts:535
implicitGrantAccessTokenLifespan?string | nullrecipe/oauth2provider/types.ts:526
implicitGrantIdTokenLifespan?string | nullrecipe/oauth2provider/types.ts:527
logoUri?stringrecipe/oauth2provider/types.ts:539
metadata?Record<string, any>recipe/oauth2provider/types.ts:542
policyUri?stringrecipe/oauth2provider/types.ts:540
postLogoutRedirectUris?string[]recipe/oauth2provider/types.ts:520
redirectUris?string[] | nullrecipe/oauth2provider/types.ts:519
refreshTokenGrantAccessTokenLifespan?string | nullrecipe/oauth2provider/types.ts:528
refreshTokenGrantIdTokenLifespan?string | nullrecipe/oauth2provider/types.ts:529
refreshTokenGrantRefreshTokenLifespan?string | nullrecipe/oauth2provider/types.ts:530
responseTypes?string[] | nullrecipe/oauth2provider/types.ts:536
scopestringrecipe/oauth2provider/types.ts:518
tokenEndpointAuthMethodstringrecipe/oauth2provider/types.ts:532
tosUri?stringrecipe/oauth2provider/types.ts:541
updatedAtstringrecipe/oauth2provider/types.ts:514

PayloadBuilderFunction()

type PayloadBuilderFunction = (user, scopes, sessionHandle, userContext) => Promise<JSONObject>;

Defined in: recipe/oauth2provider/types.ts:579

Parameters

ParameterType
userUser
scopesstring[]
sessionHandlestring
userContextUserContext

Returns

Promise<JSONObject>

RecipeInterface

type RecipeInterface = object;

Defined in: recipe/oauth2provider/types.ts:178

Methods

acceptConsentRequest()
acceptConsentRequest(input): Promise<
| ErrorOAuth2
| {
redirectTo: string;
status: "OK";
}>;

Defined in: recipe/oauth2provider/types.ts:191

Parameters
ParameterType
input{ challenge: string; context?: any; grantAccessTokenAudience?: string[]; grantScope?: string[]; handledAt?: string; initialAccessTokenPayload: JSONObject | undefined; initialIdTokenPayload: JSONObject | undefined; rsub: string; sessionHandle: string; tenantId: string; userContext: UserContext; }
input.challengestring
input.context?any
input.grantAccessTokenAudience?string[]
input.grantScope?string[]
input.handledAt?string
input.initialAccessTokenPayloadJSONObject | undefined
input.initialIdTokenPayloadJSONObject | undefined
input.rsubstring
input.sessionHandlestring
input.tenantIdstring
input.userContextUserContext
Returns

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

acceptLoginRequest()
acceptLoginRequest(input): Promise<
| ErrorOAuth2
| {
redirectTo: string;
status: "OK";
}>;

Defined in: recipe/oauth2provider/types.ts:222

Parameters
ParameterType
input{ acr?: string; amr?: string[]; challenge: string; context?: any; extendSessionLifespan?: boolean; identityProviderSessionId?: string; subject: string; userContext: UserContext; }
input.acr?string
input.amr?string[]
input.challengestring
input.context?any
input.extendSessionLifespan?boolean
input.identityProviderSessionId?string
input.subjectstring
input.userContextUserContext
Returns

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

acceptLogoutRequest()
acceptLogoutRequest(input): Promise<
| ErrorOAuth2
| {
redirectTo: string;
}>;

Defined in: recipe/oauth2provider/types.ts:412

Parameters
ParameterType
input{ challenge: string; userContext: UserContext; }
input.challengestring
input.userContextUserContext
Returns

Promise< | ErrorOAuth2 | { redirectTo: string; }>

authorization()
authorization(input): Promise<
| ErrorOAuth2
| {
cookies: string[] | undefined;
redirectTo: string;
}>;

Defined in: recipe/oauth2provider/types.ts:179

Parameters
ParameterType
input{ cookies: string | undefined; params: Record<string, string>; session: SessionContainerInterface | undefined; userContext: UserContext; }
input.cookiesstring | undefined
input.paramsRecord<string, string>
input.sessionSessionContainerInterface | undefined
input.userContextUserContext
Returns

Promise< | ErrorOAuth2 | { cookies: string[] | undefined; redirectTo: string; }>

buildAccessTokenPayload()
buildAccessTokenPayload(input): Promise<JSONObject>;

Defined in: recipe/oauth2provider/types.ts:342

Parameters
ParameterType
input{ client: OAuth2Client; scopes: string[]; sessionHandle: string | undefined; user: User | undefined; userContext: UserContext; }
input.clientOAuth2Client
input.scopesstring[]
input.sessionHandlestring | undefined
input.userUser | undefined
input.userContextUserContext
Returns

Promise<JSONObject>

buildIdTokenPayload()
buildIdTokenPayload(input): Promise<JSONObject>;

Defined in: recipe/oauth2provider/types.ts:349

Parameters
ParameterType
input{ client: OAuth2Client; scopes: string[]; sessionHandle: string | undefined; user: User | undefined; userContext: UserContext; }
input.clientOAuth2Client
input.scopesstring[]
input.sessionHandlestring | undefined
input.userUser | undefined
input.userContextUserContext
Returns

Promise<JSONObject>

buildUserInfo()
buildUserInfo(input): Promise<JSONObject>;

Defined in: recipe/oauth2provider/types.ts:356

Parameters
ParameterType
input{ accessTokenPayload: JSONObject; scopes: string[]; tenantId: string; user: User; userContext: UserContext; }
input.accessTokenPayloadJSONObject
input.scopesstring[]
input.tenantIdstring
input.userUser
input.userContextUserContext
Returns

Promise<JSONObject>

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

Defined in: recipe/oauth2provider/types.ts:279

Parameters
ParameterType
inputPartial<Omit<OAuth2ClientOptions, "createdAt" | "updatedAt">> & object
Returns

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

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

Defined in: recipe/oauth2provider/types.ts:309

Parameters
ParameterType
inputDeleteOAuth2ClientInput & object
Returns

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

endSession()
endSession(input): Promise<
| ErrorOAuth2
| {
redirectTo: string;
}>;

Defined in: recipe/oauth2provider/types.ts:406

Parameters
ParameterType
input{ params: Record<string, string>; session?: SessionContainerInterface; shouldTryRefresh: boolean; userContext: UserContext; }
input.paramsRecord<string, string>
input.session?SessionContainerInterface
input.shouldTryRefreshboolean
input.userContextUserContext
Returns

Promise< | ErrorOAuth2 | { redirectTo: string; }>

getConsentRequest()
getConsentRequest(input): Promise<ErrorOAuth2 | ConsentRequest>;

Defined in: recipe/oauth2provider/types.ts:190

Parameters
ParameterType
input{ challenge: string; userContext: UserContext; }
input.challengestring
input.userContextUserContext
Returns

Promise<ErrorOAuth2 | ConsentRequest>

getFrontendRedirectionURL()
getFrontendRedirectionURL(input): Promise<string>;

Defined in: recipe/oauth2provider/types.ts:363

Parameters
ParameterType
input| { forceFreshAuth: boolean; hint: string | undefined; loginChallenge: string; tenantId: string; type: "login"; userContext: UserContext; } | { loginChallenge: string; type: "try-refresh"; userContext: UserContext; } | { logoutChallenge: string; type: "logout-confirmation"; userContext: UserContext; } | { type: "post-logout-fallback"; userContext: UserContext; }
Returns

Promise<string>

getLoginRequest()
getLoginRequest(input): Promise<
| ErrorOAuth2
| LoginRequest & object>;

Defined in: recipe/oauth2provider/types.ts:218

Parameters
ParameterType
input{ challenge: string; userContext: UserContext; }
input.challengestring
input.userContextUserContext
Returns

Promise< | ErrorOAuth2 | LoginRequest & object>

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

Defined in: recipe/oauth2provider/types.ts:252

Parameters
ParameterType
input{ clientId: string; userContext: UserContext; }
input.clientIdstring
input.userContextUserContext
Returns

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

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

Defined in: recipe/oauth2provider/types.ts:263

Parameters
ParameterType
inputGetOAuth2ClientsInput & object
Returns

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

getRequestedScopes()
getRequestedScopes(input): Promise<string[]>;

Defined in: recipe/oauth2provider/types.ts:335

Parameters
ParameterType
input{ clientId: string; recipeUserId: RecipeUserId | undefined; scopeParam: string[]; sessionHandle: string | undefined; userContext: UserContext; }
input.clientIdstring
input.recipeUserIdRecipeUserId | undefined
input.scopeParamstring[]
input.sessionHandlestring | undefined
input.userContextUserContext
Returns

Promise<string[]>

introspectToken()
introspectToken(input): Promise<
| InstrospectTokenResponse & { status: "OK"; }
| ErrorOAuth2>;

Defined in: recipe/oauth2provider/types.ts:401

Parameters
ParameterType
input{ scopes?: string[]; token: string; userContext: UserContext; }
input.scopes?string[]
input.tokenstring
input.userContextUserContext
Returns

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

rejectConsentRequest()
rejectConsentRequest(input): Promise<
| ErrorOAuth2
| {
redirectTo: string;
status: "OK";
}>;

Defined in: recipe/oauth2provider/types.ts:212

Parameters
ParameterType
input{ challenge: string; error: ErrorOAuth2; userContext: UserContext; }
input.challengestring
input.errorErrorOAuth2
input.userContextUserContext
Returns

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

rejectLoginRequest()
rejectLoginRequest(input): Promise<
| ErrorOAuth2
| {
redirectTo: string;
status: "OK";
}>;

Defined in: recipe/oauth2provider/types.ts:246

Parameters
ParameterType
input{ challenge: string; error: ErrorOAuth2; userContext: UserContext; }
input.challengestring
input.errorErrorOAuth2
input.userContextUserContext
Returns

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

rejectLogoutRequest()
rejectLogoutRequest(input): Promise<{
status: "OK";
}>;

Defined in: recipe/oauth2provider/types.ts:416

Parameters
ParameterType
input{ challenge: string; userContext: UserContext; }
input.challengestring
input.userContextUserContext
Returns

Promise<{ status: "OK"; }>

revokeToken()
revokeToken(input): Promise<
| ErrorOAuth2
| {
status: "OK";
}>;

Defined in: recipe/oauth2provider/types.ts:388

Parameters
ParameterType
inputobject & | { authorizationHeader: string; } | { clientId: string; clientSecret?: string; }
Returns

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

revokeTokensByClientId()
revokeTokensByClientId(input): Promise<{
status: "OK";
}>;

Defined in: recipe/oauth2provider/types.ts:399

Parameters
ParameterType
input{ clientId: string; userContext: UserContext; }
input.clientIdstring
input.userContextUserContext
Returns

Promise<{ status: "OK"; }>

revokeTokensBySessionHandle()
revokeTokensBySessionHandle(input): Promise<{
status: "OK";
}>;

Defined in: recipe/oauth2provider/types.ts:400

Parameters
ParameterType
input{ sessionHandle: string; userContext: UserContext; }
input.sessionHandlestring
input.userContextUserContext
Returns

Promise<{ status: "OK"; }>

tokenExchange()
tokenExchange(input): Promise<ErrorOAuth2 | TokenInfo>;

Defined in: recipe/oauth2provider/types.ts:185

Parameters
ParameterType
input{ authorizationHeader?: string; body: Record<string, string | undefined>; userContext: UserContext; }
input.authorizationHeader?string
input.bodyRecord<string, string | undefined>
input.userContextUserContext
Returns

Promise<ErrorOAuth2 | TokenInfo>

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

Defined in: recipe/oauth2provider/types.ts:294

Parameters
ParameterType
inputNonNullableProperties<Omit<Partial<Omit<OAuth2ClientOptions, "createdAt" | "updatedAt">>, "redirectUris" | "grantTypes" | "responseTypes" | "metadata">> & object & object
Returns

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

validateOAuth2AccessToken()
validateOAuth2AccessToken(input): Promise<{
payload: JSONObject;
status: "OK";
}>;

Defined in: recipe/oauth2provider/types.ts:324

Parameters
ParameterType
input{ checkDatabase?: boolean; requirements?: { audience?: string; clientId?: string; scopes?: string[]; }; token: string; userContext: UserContext; }
input.checkDatabase?boolean
input.requirements?{ audience?: string; clientId?: string; scopes?: string[]; }
input.requirements.audience?string
input.requirements.clientId?string
input.requirements.scopes?string[]
input.tokenstring
input.userContextUserContext
Returns

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

TokenInfo

type TokenInfo = object;

Defined in: recipe/oauth2provider/types.ts:136

Properties

TypeInput

type TypeInput = object;

Defined in: recipe/oauth2provider/types.ts:24

Properties

PropertyTypeDefined in
override?objectrecipe/oauth2provider/types.ts:25
override.apis?(originalImplementation, builder) => APIInterfacerecipe/oauth2provider/types.ts:30
override.functions?(originalImplementation, builder) => RecipeInterfacerecipe/oauth2provider/types.ts:26

TypeNormalisedInput

type TypeNormalisedInput = object;

Defined in: recipe/oauth2provider/types.ts:34

Properties

PropertyTypeDefined in
overrideobjectrecipe/oauth2provider/types.ts:35
override.apis(originalImplementation, builder) => APIInterfacerecipe/oauth2provider/types.ts:40
override.functions(originalImplementation, builder) => RecipeInterfacerecipe/oauth2provider/types.ts:36

UpdateOAuth2ClientInput

type UpdateOAuth2ClientInput = NonNullableProperties<Omit<CreateOAuth2ClientInput, "redirectUris" | "grantTypes" | "responseTypes" | "metadata">> & object;

Defined in: recipe/oauth2provider/types.ts:565

Type Declaration

NameTypeDefined in
clientIdstringrecipe/oauth2provider/types.ts:568
grantTypes?string[] | nullrecipe/oauth2provider/types.ts:570
metadata?Record<string, any> | nullrecipe/oauth2provider/types.ts:572
redirectUris?string[] | nullrecipe/oauth2provider/types.ts:569
responseTypes?string[] | nullrecipe/oauth2provider/types.ts:571

UserInfo

type UserInfo = object;

Defined in: recipe/oauth2provider/types.ts:167

Indexable

[key: string]: JSONValue

Properties

PropertyTypeDefined in
email?stringrecipe/oauth2provider/types.ts:169
email_verified?booleanrecipe/oauth2provider/types.ts:170
phoneNumber?stringrecipe/oauth2provider/types.ts:171
phoneNumber_verified?booleanrecipe/oauth2provider/types.ts:172
substringrecipe/oauth2provider/types.ts:168

UserInfoBuilderFunction()

type UserInfoBuilderFunction = (user, accessTokenPayload, scopes, tenantId, userContext) => Promise<JSONObject>;

Defined in: recipe/oauth2provider/types.ts:585

Parameters

ParameterType
userUser
accessTokenPayloadJSONObject
scopesstring[]
tenantIdstring
userContextUserContext

Returns

Promise<JSONObject>