Skip to content
Esc
navigateopen⌘Jpreview
Dashboard
On this page

supertokens-web-js/recipe/oauth2provider

References documentation for the supertokens-web-js/recipe/oauth2provider package

Classes

default

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

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

Returns information about an OAuth login in progress

Parameters
Parameter Type
input { loginChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.loginChallenge string
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

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

Parameters
Parameter Type
input { loginChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.loginChallenge string
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

Parameters
Parameter Type
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

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

Parameters
Parameter Type
input { logoutChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.logoutChallenge string
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

Returns information about an OAuth login in progress

Parameters

Parameter Type
input { loginChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.loginChallenge string
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

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

Parameters

Parameter Type
input { loginChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.loginChallenge string
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

Parameters

Parameter Type
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

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

Parameters

Parameter Type
input { logoutChallenge: string; options?: RecipeFunctionOptions; userContext?: any; }
input.logoutChallenge string
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

API reference

API schema and response details