RecipeInterface
RecipeInterface: { acceptConsentRequest: any; acceptLoginRequest: any; acceptLogoutRequest: any; authorization: any; buildAccessTokenPayload: any; buildIdTokenPayload: any; buildUserInfo: any; createOAuth2Client: any; deleteOAuth2Client: any; endSession: any; getConsentRequest: any; getFrontendRedirectionURL: any; getLoginRequest: any; getOAuth2Client: any; getOAuth2Clients: any; getRequestedScopes: any; introspectToken: any; rejectConsentRequest: any; rejectLoginRequest: any; rejectLogoutRequest: any; revokeToken: any; revokeTokensByClientId: any; revokeTokensBySessionHandle: any; tokenExchange: any; updateOAuth2Client: any; validateOAuth2AccessToken: any }
Type declaration
acceptConsentRequest:function
- acceptConsentRequest(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 }): Promise<{ redirectTo: string }>
Parameters
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 }
challenge: string
Optional context?: any
Optional grantAccessTokenAudience?: string[]
Optional grantScope?: string[]
Optional handledAt?: string
initialAccessTokenPayload: JSONObject | undefined
initialIdTokenPayload: JSONObject | undefined
rsub: string
sessionHandle: string
tenantId: string
userContext: UserContext
Returns Promise<{ redirectTo: string }>
acceptLoginRequest:function
- acceptLoginRequest(input: { acr?: string; amr?: string[]; challenge: string; context?: any; extendSessionLifespan?: boolean; identityProviderSessionId?: string; subject: string; userContext: UserContext }): Promise<{ redirectTo: string }>
Parameters
input: { acr?: string; amr?: string[]; challenge: string; context?: any; extendSessionLifespan?: boolean; identityProviderSessionId?: string; subject: string; userContext: UserContext }
Optional acr?: string
Optional amr?: string[]
challenge: string
Optional context?: any
Optional extendSessionLifespan?: boolean
Optional identityProviderSessionId?: string
subject: string
userContext: UserContext
Returns Promise<{ redirectTo: string }>
acceptLogoutRequest:function
- acceptLogoutRequest(input: { challenge: string; userContext: UserContext }): Promise<ErrorOAuth2 | { redirectTo: string }>
Parameters
input: { challenge: string; userContext: UserContext }
challenge: string
userContext: UserContext
Returns Promise<ErrorOAuth2 | { redirectTo: string }>
authorization:function
- authorization(input: { cookies: string | undefined; params: Record<string, string>; session: SessionContainer | undefined; userContext: UserContext }): Promise<ErrorOAuth2 | { cookies: string | undefined; redirectTo: string }>
Parameters
input: { cookies: string | undefined; params: Record<string, string>; session: SessionContainer | undefined; userContext: UserContext }
cookies: string | undefined
params: Record<string, string>
userContext: UserContext
Returns Promise<ErrorOAuth2 | { cookies: string | undefined; redirectTo: string }>
buildAccessTokenPayload:function
- buildAccessTokenPayload(input: { client: OAuth2Client; scopes: string[]; sessionHandle: string | undefined; user: User | undefined; userContext: UserContext }): Promise<JSONObject>
Parameters
input: { client: OAuth2Client; scopes: string[]; sessionHandle: string | undefined; user: User | undefined; userContext: UserContext }
client: OAuth2Client
scopes: string[]
sessionHandle: string | undefined
user: User | undefined
userContext: UserContext
buildIdTokenPayload:function
- buildIdTokenPayload(input: { client: OAuth2Client; scopes: string[]; sessionHandle: string | undefined; user: User | undefined; userContext: UserContext }): Promise<JSONObject>
Parameters
input: { client: OAuth2Client; scopes: string[]; sessionHandle: string | undefined; user: User | undefined; userContext: UserContext }
client: OAuth2Client
scopes: string[]
sessionHandle: string | undefined
user: User | undefined
userContext: UserContext
buildUserInfo:function
- buildUserInfo(input: { accessTokenPayload: JSONObject; scopes: string[]; tenantId: string; user: User; userContext: UserContext }): Promise<JSONObject>
Parameters
input: { accessTokenPayload: JSONObject; scopes: string[]; tenantId: string; user: User; userContext: UserContext }
scopes: string[]
tenantId: string
userContext: UserContext
createOAuth2Client:function
- createOAuth2Client(input: Partial<Omit<OAuth2ClientOptions, "createdAt" | "updatedAt">> & { userContext: UserContext }): Promise<{ client: OAuth2Client; status: "OK" } | { error: string; errorDescription: string; status: "ERROR" }>
Parameters
input: Partial<Omit<OAuth2ClientOptions, "createdAt" | "updatedAt">> & { userContext: UserContext }
Returns Promise<{ client: OAuth2Client; status: "OK" } | { error: string; errorDescription: string; status: "ERROR" }>
deleteOAuth2Client:function
- deleteOAuth2Client(input: DeleteOAuth2ClientInput & { userContext: UserContext }): Promise<{ status: "OK" } | { error: string; errorDescription: string; status: "ERROR" }>
Parameters
input: DeleteOAuth2ClientInput & { userContext: UserContext }
Returns Promise<{ status: "OK" } | { error: string; errorDescription: string; status: "ERROR" }>
endSession:function
- endSession(input: { params: Record<string, string>; session?: SessionContainer; shouldTryRefresh: boolean; userContext: UserContext }): Promise<ErrorOAuth2 | { redirectTo: string }>
Parameters
input: { params: Record<string, string>; session?: SessionContainer; shouldTryRefresh: boolean; userContext: UserContext }
params: Record<string, string>
shouldTryRefresh: boolean
userContext: UserContext
Returns Promise<ErrorOAuth2 | { redirectTo: string }>
getConsentRequest:function
- getConsentRequest(input: { challenge: string; userContext: UserContext }): Promise<ConsentRequest>
Parameters
input: { challenge: string; userContext: UserContext }
challenge: string
userContext: UserContext
Returns Promise<ConsentRequest>
getFrontendRedirectionURL:function
- getFrontendRedirectionURL(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 }): Promise<string>
Parameters
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:function
- getLoginRequest(input: { challenge: string; userContext: UserContext }): Promise<ErrorOAuth2 | LoginRequest & { status: "OK" }>
Parameters
input: { challenge: string; userContext: UserContext }
challenge: string
userContext: UserContext
Returns Promise<ErrorOAuth2 | LoginRequest & { status: "OK" }>
getOAuth2Client:function
- getOAuth2Client(input: { clientId: string; userContext: UserContext }): Promise<{ client: OAuth2Client; status: "OK" } | { error: string; errorDescription: string; status: "ERROR" }>
Parameters
input: { clientId: string; userContext: UserContext }
clientId: string
userContext: UserContext
Returns Promise<{ client: OAuth2Client; status: "OK" } | { error: string; errorDescription: string; status: "ERROR" }>
getOAuth2Clients:function
- getOAuth2Clients(input: GetOAuth2ClientsInput & { userContext: UserContext }): Promise<{ clients: OAuth2Client[]; nextPaginationToken?: string; status: "OK" } | { error: string; errorDescription: string; status: "ERROR" }>
Parameters
input: GetOAuth2ClientsInput & { userContext: UserContext }
Returns Promise<{ clients: OAuth2Client[]; nextPaginationToken?: string; status: "OK" } | { error: string; errorDescription: string; status: "ERROR" }>
getRequestedScopes:function
- getRequestedScopes(input: { clientId: string; recipeUserId: RecipeUserId | undefined; scopeParam: string[]; sessionHandle: string | undefined; userContext: UserContext }): Promise<string[]>
Parameters
input: { clientId: string; recipeUserId: RecipeUserId | undefined; scopeParam: string[]; sessionHandle: string | undefined; userContext: UserContext }
clientId: string
recipeUserId: RecipeUserId | undefined
scopeParam: string[]
sessionHandle: string | undefined
userContext: UserContext
Returns Promise<string[]>
introspectToken:function
- introspectToken(input: { scopes?: string[]; token: string; userContext: UserContext }): Promise<InstrospectTokenResponse>
Parameters
input: { scopes?: string[]; token: string; userContext: UserContext }
Optional scopes?: string[]
token: string
userContext: UserContext
Returns Promise<InstrospectTokenResponse>
rejectConsentRequest:function
- rejectConsentRequest(input: { challenge: string; error: ErrorOAuth2; userContext: UserContext }): Promise<{ redirectTo: string }>
Parameters
input: { challenge: string; error: ErrorOAuth2; userContext: UserContext }
challenge: string
error: ErrorOAuth2
userContext: UserContext
Returns Promise<{ redirectTo: string }>
rejectLoginRequest:function
- rejectLoginRequest(input: { challenge: string; error: ErrorOAuth2; userContext: UserContext }): Promise<{ redirectTo: string }>
Parameters
input: { challenge: string; error: ErrorOAuth2; userContext: UserContext }
challenge: string
error: ErrorOAuth2
userContext: UserContext
Returns Promise<{ redirectTo: string }>
rejectLogoutRequest:function
- rejectLogoutRequest(input: { challenge: string; userContext: UserContext }): Promise<{ status: "OK" }>
Parameters
input: { challenge: string; userContext: UserContext }
challenge: string
userContext: UserContext
Returns Promise<{ status: "OK" }>
revokeToken:function
- revokeToken(input: { token: string; userContext: UserContext } & { authorizationHeader: string } & { token: string; userContext: UserContext } & { clientId: string; clientSecret?: string }): Promise<ErrorOAuth2 | { status: "OK" }>
Parameters
input: { token: string; userContext: UserContext } & { authorizationHeader: string } & { token: string; userContext: UserContext } & { clientId: string; clientSecret?: string }
Returns Promise<ErrorOAuth2 | { status: "OK" }>
revokeTokensByClientId:function
- revokeTokensByClientId(input: { clientId: string; userContext: UserContext }): Promise<{ status: "OK" }>
Parameters
input: { clientId: string; userContext: UserContext }
clientId: string
userContext: UserContext
Returns Promise<{ status: "OK" }>
revokeTokensBySessionHandle:function
- revokeTokensBySessionHandle(input: { sessionHandle: string; userContext: UserContext }): Promise<{ status: "OK" }>
Parameters
input: { sessionHandle: string; userContext: UserContext }
sessionHandle: string
userContext: UserContext
Returns Promise<{ status: "OK" }>
tokenExchange:function
- tokenExchange(input: { authorizationHeader?: string; body: Record<string, string | undefined>; userContext: UserContext }): Promise<TokenInfo | ErrorOAuth2>
Parameters
input: { authorizationHeader?: string; body: Record<string, string | undefined>; userContext: UserContext }
Optional authorizationHeader?: string
body: Record<string, string | undefined>
userContext: UserContext
Returns Promise<TokenInfo | ErrorOAuth2>
updateOAuth2Client:function
- updateOAuth2Client(input: NonNullableProperties<Omit<Partial<Omit<OAuth2ClientOptions, "createdAt" | "updatedAt">>, "redirectUris" | "grantTypes" | "responseTypes" | "metadata">> & { clientId: string; grantTypes?: string[] | null; metadata?: Record<string, any> | null; redirectUris?: string[] | null; responseTypes?: string[] | null } & { userContext: UserContext }): Promise<{ client: OAuth2Client; status: "OK" } | { error: string; errorDescription: string; status: "ERROR" }>
Parameters
input: NonNullableProperties<Omit<Partial<Omit<OAuth2ClientOptions, "createdAt" | "updatedAt">>, "redirectUris" | "grantTypes" | "responseTypes" | "metadata">> & { clientId: string; grantTypes?: string[] | null; metadata?: Record<string, any> | null; redirectUris?: string[] | null; responseTypes?: string[] | null } & { userContext: UserContext }
Returns Promise<{ client: OAuth2Client; status: "OK" } | { error: string; errorDescription: string; status: "ERROR" }>
validateOAuth2AccessToken:function
- validateOAuth2AccessToken(input: { checkDatabase?: boolean; requirements?: { audience?: string; clientId?: string; scopes?: string[] }; token: string; userContext: UserContext }): Promise<{ payload: JSONObject; status: "OK" }>
Parameters
input: { checkDatabase?: boolean; requirements?: { audience?: string; clientId?: string; scopes?: string[] }; token: string; userContext: UserContext }
Optional checkDatabase?: boolean
Optional requirements?: { audience?: string; clientId?: string; scopes?: string[] }
Optional audience?: string
Optional clientId?: string
Optional scopes?: string[]
token: string
userContext: UserContext
Returns Promise<{ payload: JSONObject; status: "OK" }>