---
title: supertokens-auth-react/recipe/oauth2provider
description: References documentation for the supertokens-auth-react/recipe/oauth2provider package
sidebar:
  order: 110
---

## Classes

### default

Defined in: [recipe/oauth2provider/index.ts:23](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/oauth2provider/index.ts#L23)

#### Constructors

##### Constructor

```ts check=false reason="Generated API signature"
new default(): default;
```

###### Returns

[`default`](#default)

#### Properties

| Property | Modifier | Type | Default value | Defined in |
| ------ | ------ | ------ | ------ | ------ |
| <a id="componentsoverrideprovider"></a> `ComponentsOverrideProvider` | `static` | `any` | `RecipeComponentsOverrideContextProvider` | [recipe/oauth2provider/index.ts:99](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/oauth2provider/index.ts#L99) |

#### Methods

##### getLoginChallengeInfo()

```ts check=false reason="Generated API signature"
static getLoginChallengeInfo(input): Promise<{
  fetchResponse: Response;
  info: LoginInfo;
  status: "OK";
}>;
```

Defined in: [recipe/oauth2provider/index.ts:41](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/oauth2provider/index.ts#L41)

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()

```ts check=false reason="Generated API signature"
static getRedirectURLToContinueOAuthFlow(input): Promise<{
  fetchResponse: Response;
  frontendRedirectTo: string;
  status: "OK";
}>;
```

Defined in: [recipe/oauth2provider/index.ts:66](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/oauth2provider/index.ts#L66)

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()

```ts check=false reason="Generated API signature"
static init(config?): RecipeInitResult<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext, NormalisedConfig>;
```

Defined in: [recipe/oauth2provider/index.ts:24](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/oauth2provider/index.ts#L24)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | [`UserInput`](recipe-oauth2provider-types#userinput) |

###### Returns

[`RecipeInitResult`](types#recipeinitresult)\<[`GetRedirectionURLContext`](recipe-oauth2provider-types#getredirectionurlcontext), [`PreAndPostAPIHookAction`](recipe-oauth2provider-types#preandpostapihookaction), [`OnHandleEventContext`](recipe-oauth2provider-types#onhandleeventcontext), [`NormalisedConfig`](recipe-oauth2provider-types#normalisedconfig)\>

##### logOut()

```ts check=false reason="Generated API signature"
static logOut(input): Promise<{
  fetchResponse: Response;
  frontendRedirectTo: string;
  status: "OK";
}>;
```

Defined in: [recipe/oauth2provider/index.ts:91](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/oauth2provider/index.ts#L91)

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()

```ts check=false reason="Generated API signature"
const getLoginChallengeInfo: (input) => Promise<{
  fetchResponse: Response;
  info: LoginInfo;
  status: "OK";
}> = Wrapper.getLoginChallengeInfo;
```

Defined in: [recipe/oauth2provider/index.ts:103](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/oauth2provider/index.ts#L103)

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"`

***

### init()

```ts check=false reason="Generated API signature"
const init: (config?) => RecipeInitResult<GetRedirectionURLContext, PreAndPostAPIHookAction, OnHandleEventContext, NormalisedConfig> = Wrapper.init;
```

Defined in: [recipe/oauth2provider/index.ts:102](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/oauth2provider/index.ts#L102)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | [`UserInput`](recipe-oauth2provider-types#userinput) |

#### Returns

[`RecipeInitResult`](types#recipeinitresult)\<[`GetRedirectionURLContext`](recipe-oauth2provider-types#getredirectionurlcontext), [`PreAndPostAPIHookAction`](recipe-oauth2provider-types#preandpostapihookaction), [`OnHandleEventContext`](recipe-oauth2provider-types#onhandleeventcontext), [`NormalisedConfig`](recipe-oauth2provider-types#normalisedconfig)\>

***

### logOut()

```ts check=false reason="Generated API signature"
const logOut: (input) => Promise<{
  fetchResponse: Response;
  frontendRedirectTo: string;
  status: "OK";
}> = Wrapper.logOut;
```

Defined in: [recipe/oauth2provider/index.ts:104](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/oauth2provider/index.ts#L104)

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

### GetRedirectionURLContext

Re-exports [GetRedirectionURLContext](recipe-oauth2provider-types#getredirectionurlcontext)

***

### OnHandleEventContext

Re-exports [OnHandleEventContext](recipe-oauth2provider-types#onhandleeventcontext)

***

### PreAPIHookContext

Re-exports [PreAPIHookContext](recipe-oauth2provider-types#preapihookcontext)

***

### RecipeComponentsOverrideContextProvider

Renames and re-exports [SuperTokensWrapper](index#supertokenswrapper-1)

***

### RecipeInterface

Renames and re-exports [SuperTokensWrapper](index#supertokenswrapper-1)

***

### UserInput

Re-exports [UserInput](recipe-oauth2provider-types#userinput)
