> For the complete documentation index, see [llms.txt](/llms.txt).

# Reddit sign-in with Embedded Wallets

[Reddit OAuth](https://github.com/reddit-archive/reddit/wiki/OAuth2) lets users authenticate with a Reddit account. Choose the default connection for the quickest setup, or configure a custom connection when you need your own Reddit app, consent screen, or identity provider.

## Default Reddit sign-in[​](#default-reddit-sign-in "Direct link to Default Reddit sign-in")

The default connection uses the Reddit OAuth credentials managed by Embedded Wallets. You don't need a Reddit developer application.

### Caveats[​](#caveats "Direct link to Caveats")

- The Reddit consent screen identifies the OAuth application managed by Embedded Wallets, not your dapp.
- You can't change the Reddit application configuration, such as its scopes or branding, because you don't own the credentials.
- The default connection and a custom connection are separate connections, so they produce different wallet addresses for the same person unless you link them with a [group connection](/embedded-wallets/authentication/group-connections/).

### Configure the default connection[​](#configure-the-default-connection "Direct link to Configure the default connection")

1. Open your project in the [MetaMask Developer Dashboard](https://developer.metamask.io).
2. Select **Social Connections**.
3. Enable **Reddit**.
![Reddit in the Social Connections settings](/assets/images/authentication-social-connections-39836c31a54393f4387abf946cf59a2f.png) 

The SDK reads the connection from the dashboard. You don't need to add Reddit credentials to your SDK configuration.

## Custom Reddit sign-in[​](#custom-reddit-sign-in "Direct link to Custom Reddit sign-in")

Use a custom connection when the Reddit authorization belongs to your dapp or an identity platform you control. Your Reddit credentials sit in Auth0 or your own backend.

Reddit credentials can't go in the dashboard

Google, Discord, and Twitch connections take only a client ID, because they accept `https://auth.web3auth.io/auth` as a redirect URI for a public client. Reddit OAuth uses a confidential client (a client secret) to exchange the authorization code, so Embedded Wallets doesn't accept a Reddit client ID on the social connection.

Preserve wallet addresses

Decide between the default and a custom connection before you onboard users. Moving from the default Reddit connection to Auth0 or your own JWT connection changes every user's wallet address unless both connections are in a [group connection](/embedded-wallets/authentication/group-connections/) with matching user identifiers.

### Auth0[​](#auth0 "Direct link to Auth0")

Auth0 doesn't list Reddit as a built-in social connection in the same catalog as Google or GitHub. Add Reddit with an Auth0 [custom OAuth 2.0 connection](https://auth0.com/docs/authenticate/identity-providers/social-identity-providers/oauth2), then [create an Auth0 connection](/embedded-wallets/authentication/custom-connections/auth0/) in the MetaMask Developer Dashboard. Set `extraLoginOptions.connection` to the name Auth0 assigned to that connection.

Firebase Authentication and Amazon Cognito don't offer Reddit as a first-party social provider.

### Your own backend[​](#your-own-backend "Direct link to Your own backend")

1. Complete Reddit OAuth in your client and send the result to your backend.
2. Exchange the authorization code with Reddit's token endpoint using your client secret, then validate the user identity before trusting it.
3. Issue a fresh JWT with an `iat` no more than 60 seconds old and expose the signing public key through a JSON Web Key Set (JWKS) endpoint.
4. [Create a custom JWT connection](/embedded-wallets/authentication/custom-connections/custom-jwt/) that validates your issuer, audience, JWKS, and user identifier.
5. Pass your JWT and custom connection ID to Embedded Wallets.

Don't send a Reddit client secret to a client application.

## Group Reddit connections[​](#group-reddit-connections "Direct link to Group Reddit connections")

A [group connection](/embedded-wallets/authentication/group-connections/) gives the same person one wallet address across several login methods.

Default Reddit and Reddit through Auth0 or your JWT are separate connections. They produce different wallet addresses unless you group them and every connection in the group uses the same JWT user identifier (`email` or an aligned `sub`).

Pass both the child connection ID and grouped connection ID when you bypass the modal:

```
await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<REDDIT_AUTH_CONNECTION_ID>',
  groupedAuthConnectionId: '<GROUPED_AUTH_CONNECTION_ID>',
  idToken,
})

```

## Usage examples[​](#usage-examples "Direct link to Usage examples")

The implicit examples open the default Reddit authorization flow. The JWT examples assume your Auth0 or backend integration has already returned a fresh ID token.

### Default implicit flow

- React
- Vue
- JavaScript
- React Native
- Android
- iOS
- Flutter
- Unity
- Unreal Engine

```
import { AUTH_CONNECTION, WALLET_CONNECTORS } from '@web3auth/modal'
import { useWeb3AuthConnect } from '@web3auth/modal/react'

const { connectTo } = useWeb3AuthConnect()

await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.REDDIT,
})

```

```
import { AUTH_CONNECTION, WALLET_CONNECTORS } from '@web3auth/modal'
import { useWeb3AuthConnect } from '@web3auth/modal/vue'

const { connectTo } = useWeb3AuthConnect()

await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.REDDIT,
})

```

```
import { AUTH_CONNECTION, WALLET_CONNECTORS } from '@web3auth/modal'

await web3auth.connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.REDDIT,
})

```

```
import { AUTH_CONNECTION, useWeb3AuthConnect } from '@web3auth/react-native-sdk'

const { connectTo } = useWeb3AuthConnect()

await connectTo({
  authConnection: AUTH_CONNECTION.REDDIT,
})

```

```
val response = web3Auth.connectTo(
  LoginParams(AuthConnection.REDDIT)
)

```

```
let response = try await web3Auth.connectTo(
    loginParams: LoginParams(authConnection: .REDDIT)
)

```

```
final response = await Web3AuthFlutter.login(
  LoginParams(loginProvider: Provider.reddit),
);

```

```
var options = new LoginParams
{
    loginProvider = Provider.REDDIT
};

web3Auth.login(options);

```

```
FWeb3AuthLoginParams LoginParams;
LoginParams.LoginProvider = TEXT("reddit");

UWeb3AuthSDK::GetInstance()->Login(LoginParams);

```

### JWT flow

Obtain a fresh ID token from your identity aggregator or backend before calling Embedded Wallets. The token issuer and claims must match the custom connection in the dashboard.

- React
- Vue
- JavaScript
- React Native
- Android
- iOS
- Flutter
- Unity
- Unreal Engine
- Node.js

```
const idToken = await getIdToken()

await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<CUSTOM_CONNECTION_ID>',
  idToken,
})

```

```
const idToken = await getIdToken()

await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<CUSTOM_CONNECTION_ID>',
  idToken,
})

```

```
const idToken = await getIdToken()

await web3auth.connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<CUSTOM_CONNECTION_ID>',
  idToken,
})

```

```
const idToken = await getIdToken()

await connectTo({
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<CUSTOM_CONNECTION_ID>',
  idToken,
})

```

```
val response = web3Auth.connectTo(
  LoginParams(
    authConnection = AuthConnection.CUSTOM,
    authConnectionId = "<CUSTOM_CONNECTION_ID>",
    idToken = idToken
  )
)

```

```
let response = try await web3Auth.connectTo(
    loginParams: LoginParams(
        authConnection: .CUSTOM,
        authConnectionId: "<CUSTOM_CONNECTION_ID>",
        idToken: idToken
    )
)

```

```
final response = await Web3AuthFlutter.login(
  LoginParams(
    loginProvider: Provider.jwt,
    extraLoginOptions: ExtraLoginOptions(
      id_token: idToken,
    ),
  ),
);

```

```
var options = new LoginParams
{
    loginProvider = Provider.JWT,
    extraLoginOptions = new ExtraLoginOptions
    {
        id_token = idToken
    }
};

web3Auth.login(options);

```

The current Unreal Engine SDK documentation doesn't provide a verified C++ JWT example. Configure the JWT connection and login in Blueprint by following the [Unreal Engine custom authentication guide](/embedded-wallets/sdk/unreal/advanced/custom-authentication).

```
const result = await web3auth.connect({
  authConnectionId: '<CUSTOM_CONNECTION_ID>',
  idToken,
})

```
