Skip to main content
References

OAuth Provider

Classes

default

Defined in: tmp/supertokens-web-js/lib/ts/recipe/oauth2provider/index.ts:28

Constructors

Constructor
new default(): default;
Returns

default

Methods

getLoginChallengeInfo()
static getLoginChallengeInfo(input): Promise<{
fetchResponse: Response;
info: LoginInfo;
status: "OK";
}>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/oauth2provider/index.ts:46

Returns information about an OAuth login in progress

Parameters
ParameterType
input{ loginChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.loginChallengestring
input.options?RecipeFunctionOptions
input.userContext?any
Returns

Promise<{ fetchResponse: Response; info: LoginInfo; status: "OK"; }>

{status: "OK", info: LoginInfo}

Throws

STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

getRedirectURLToContinueOAuthFlow()
static getRedirectURLToContinueOAuthFlow(input): Promise<{
fetchResponse: Response;
frontendRedirectTo: string;
status: "OK";
}>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/oauth2provider/index.ts:74

Accepts the OAuth2 Login request and returns the redirect URL to continue the OAuth flow.

Parameters
ParameterType
input{ loginChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.loginChallengestring
input.options?RecipeFunctionOptions
input.userContext?any
Returns

Promise<{ fetchResponse: Response; frontendRedirectTo: string; status: "OK"; }>

{status: "OK", frontendRedirectTo: string}

Throws

STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

init()
static init(config?): CreateRecipeFunction<PreAndPostAPIHookAction>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/oauth2provider/index.ts:29

Parameters
ParameterType
config?UserInput
Returns

CreateRecipeFunction<PreAndPostAPIHookAction>

logOut()
static logOut(input): Promise<{
fetchResponse: Response;
frontendRedirectTo: string;
status: "OK";
}>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/oauth2provider/index.ts:102

Accepts the OAuth2 Logout request, clears the SuperTokens session and returns post logout redirect URL.

Parameters
ParameterType
input{ logoutChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.logoutChallengestring
input.options?RecipeFunctionOptions
input.userContext?any
Returns

Promise<{ fetchResponse: Response; frontendRedirectTo: string; status: "OK"; }>

{status: "OK", frontendRedirectTo: string}

Throws

STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

Variables

getLoginChallengeInfo()

const getLoginChallengeInfo: (input) => Promise<{
fetchResponse: Response;
info: LoginInfo;
status: "OK";
}> = RecipeWrapper.getLoginChallengeInfo;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/oauth2provider/index.ts:115

Returns information about an OAuth login in progress

Parameters

ParameterType
input{ loginChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.loginChallengestring
input.options?RecipeFunctionOptions
input.userContext?any

Returns

Promise<{ fetchResponse: Response; info: LoginInfo; status: "OK"; }>

{status: "OK", info: LoginInfo}

Throws

STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

getRedirectURLToContinueOAuthFlow()

const getRedirectURLToContinueOAuthFlow: (input) => Promise<{
fetchResponse: Response;
frontendRedirectTo: string;
status: "OK";
}> = RecipeWrapper.getRedirectURLToContinueOAuthFlow;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/oauth2provider/index.ts:116

Accepts the OAuth2 Login request and returns the redirect URL to continue the OAuth flow.

Parameters

ParameterType
input{ loginChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.loginChallengestring
input.options?RecipeFunctionOptions
input.userContext?any

Returns

Promise<{ fetchResponse: Response; frontendRedirectTo: string; status: "OK"; }>

{status: "OK", frontendRedirectTo: string}

Throws

STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

init()

const init: (config?) => CreateRecipeFunction<PreAndPostAPIHookAction> = RecipeWrapper.init;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/oauth2provider/index.ts:114

Parameters

ParameterType
config?UserInput

Returns

CreateRecipeFunction<PreAndPostAPIHookAction>

logOut()

const logOut: (input) => Promise<{
fetchResponse: Response;
frontendRedirectTo: string;
status: "OK";
}> = RecipeWrapper.logOut;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/oauth2provider/index.ts:117

Accepts the OAuth2 Logout request, clears the SuperTokens session and returns post logout redirect URL.

Parameters

ParameterType
input{ logoutChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.logoutChallengestring
input.options?RecipeFunctionOptions
input.userContext?any

Returns

Promise<{ fetchResponse: Response; frontendRedirectTo: string; status: "OK"; }>

{status: "OK", frontendRedirectTo: string}

Throws

STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

References

LoginInfo

Re-exports LoginInfo

PostAPIHookContext

Re-exports PostAPIHookContext

PreAndPostAPIHookAction

Re-exports PreAndPostAPIHookAction

PreAPIHookContext

Re-exports PreAPIHookContext

RecipeFunctionOptions

Re-exports RecipeFunctionOptions

RecipeInterface

Re-exports RecipeInterface

UserInput

Re-exports UserInput