> ## Documentation Index
> Fetch the complete documentation index at: https://frenglish.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticating Users

> Documentation for Unreal SDK API to manage sessions for the Sequence infrastructure stack for web3 gaming.

Visit our [Platform Requirements](/sdk/unreal/platforms) page for detailed information on setting up and ensuring
that the authentication methods you choose are properly configured in your Builder project.

## Sign In with Email OTP

Sign in users with any email, and they will receive a one-time password in their inbox.
Listen for the Email Requires Code event.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/email_otp.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=6c9804c6c00db89087007119a2ba212e" width="1131" height="400" data-path="images/unreal/email_otp.png" />
    </Frame>
  </Tab>
</Tabs>

## Social Sign In

To initiate SSO-based authentication on desktop, you need to navigate to a browser to obtain the necessary id\_token.
On mobile, our SDK handles this process for you using integrated plugins.

On desktop platforms, listen for the `Sign in Web View Required` event and open the returned `Sign In URL`.
On mobile platforms, listen for the `Id Token Received` event.

When you call the `Sign In` functions, listen for the `Session Established` event on the `SequenceSessionsBP` subsystem
to know when the sign in request was successful. Listen for `Session Creation Failure` when something went wrong.

### Get Google Id Token

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/google_idtoken.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=4177a835a01ca5433d2a9aabf71a0d02" width="1231" height="400" data-path="images/unreal/google_idtoken.png" />
    </Frame>
  </Tab>
</Tabs>

### Get Apple Id Token

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/apple_idtoken.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=5a1f7af68946ff1d3f9de2305ed86c4d" width="1255" height="400" data-path="images/unreal/apple_idtoken.png" />
    </Frame>
  </Tab>
</Tabs>

### Sign In with Google

Sign In with a valid Google Id Token. You get this from the [Get Google Id Token](/sdk/unreal/authentication#get-google-id-token) node.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/jco-kCqEz4S4wsae/images/unreal/unreal_signin_google.png?fit=max&auto=format&n=jco-kCqEz4S4wsae&q=85&s=9ce1026f452b5aa3422d7838040c21c0" width="2020" height="988" data-path="images/unreal/unreal_signin_google.png" />
    </Frame>
  </Tab>
</Tabs>

### Sign In with Apple

Sign In with a valid Apple Id Token. You get this from the [Get Apple Id Token](/sdk/unreal/authentication#get-apple-id-token) node.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/jco-kCqEz4S4wsae/images/unreal/unreal_signin_apple.png?fit=max&auto=format&n=jco-kCqEz4S4wsae&q=85&s=32744b7ef88876b7dec92cdc46ef33b8" width="2020" height="988" data-path="images/unreal/unreal_signin_apple.png" />
    </Frame>
  </Tab>
</Tabs>

### Sign In with Epic

Sign In with a valid Epic Games Id Token. Checkout the [EOS Plugin for Unreal](https://dev.epicgames.com/documentation/en-us/unreal-engine/online-subsystem-eos-plugin-in-unreal-engine)

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/jco-kCqEz4S4wsae/images/unreal/unreal_signin_epic.png?fit=max&auto=format&n=jco-kCqEz4S4wsae&q=85&s=617427502f745764ccb8d71a8f82b961" width="2020" height="988" data-path="images/unreal/unreal_signin_epic.png" />
    </Frame>
  </Tab>
</Tabs>

### Start Session with OIDC Id Token

Use this method to start a session using a valid Id token from Google, Apple or Epic Games.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/token_session.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=318d6f646747eb81645fe4b7862e2512" width="1390" height="570" data-path="images/unreal/token_session.png" />
    </Frame>
  </Tab>
</Tabs>

## PlayFab

You will need to include your PlayFab Title ID in the `SequenceConfig.ini` file
during [Configuration](/sdk/unreal/configuration) and [configure PlayFab in the Builder](/solutions/builder/embedded-wallet/playfab-configuration).

### Register a new PlayFab user

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/playfab_registration.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=ad96e62dccc867a97caf8dcce35d3d0d" width="1438" height="520" data-path="images/unreal/playfab_registration.png" />
    </Frame>
  </Tab>
</Tabs>

### Login with existing PlayFab user

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/playfab_login.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=3a9d702a63d79fe3b3bed83d30b724ea" width="1436" height="522" data-path="images/unreal/playfab_login.png" />
    </Frame>
  </Tab>
</Tabs>

### Custom PlayFab integration

If you have your own PlayFab integration, you are welcome to use it. Once you've received your SessionTicket from PlayFab, please pass it along for authentication with Sequence APIs using `PlayfabAuthenticateWithSessionTicket` method on your `USequenceAthenticator` object.

## Sign In as a Guest

You can sign in users as guests. However, note that they will lose access to their wallet if they uninstall the app or sign out.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/guest_session.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=23b3a3fb2c32954c06b9f5a45a2ce73c" width="1029" height="400" data-path="images/unreal/guest_session.png" />
    </Frame>
  </Tab>
</Tabs>

## Federate Accounts

With Federated Accounts, you can associate multiple login methods with a single account and wallet.
If your user has signed in with as a Guest, you will definitely want to push them towards federating their
account in order to have persistent credentials with which they can access their Sequence Embedded Wallet in subsequent sessions.
While a user is authenticated with the Sequence API, you can add an additional login method by using the appropriate federate account call.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/email_federation.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=d410bc79b684d492e35b024ba14df007" width="1131" height="500" data-path="images/unreal/email_federation.png" />
    </Frame>
  </Tab>
</Tabs>

## Get Id Token

A common use case is to verify the user identity on your backend after the user has finished the login process in your app client.
Get a Sequence Id Token from your users to send it to your backend for verification using any JWKS library.
Read our [Backend Verification Guide](/sdk/headless-wallet/verification) for more information.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/get_id_token.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=4c36acb32c49745a882eae6c9f93a228" width="2824" height="1302" data-path="images/unreal/get_id_token.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    const TFunction<void (FSeqIdTokenResponse_Data)> OnSuccess = [this](const FSeqIdTokenResponse_Data& Data) { };
    const TFunction<void (FSequenceError)> OnFailure = [this](const FSequenceError& Err){ };

    const TOptional<USequenceWallet*> WalletOptional = USequenceWallet::Get();
    if (WalletOptional.IsSet() && WalletOptional.GetValue())
    {
        const USequenceWallet* Wallet = WalletOptional.GetValue();
        Wallet->GetIdToken(Nonce, OnSuccess, OnFailure);
    }
    ```
  </Tab>
</Tabs>

## Sign Out

Clear the credentials cache and sign out the current user.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/sign_out.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=73f3732c3cf0835f36ba004522f43394" width="1166" height="432" data-path="images/unreal/sign_out.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    const TOptional<USequenceWallet*> WalletOptional = USequenceWallet::Get();
    if (WalletOptional.IsSet() && WalletOptional.GetValue())
    {
        USequenceWallet * Api = WalletOptional.GetValue();
        Api->SignOut();
    }
    ```
  </Tab>
</Tabs>

## List Sessions

List the active sessions.

<Tabs>
  <Tab title="Blueprint">
    <Frame>
      <img src="https://mintcdn.com/frenglish/DW77RR7YqAk4ljjJ/images/unreal/list_sessions.png?fit=max&auto=format&n=DW77RR7YqAk4ljjJ&q=85&s=b9fa90ea7e10bff33be471b39d62e533" width="1810" height="818" data-path="images/unreal/list_sessions.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    const TSuccessCallback<TArray<FSession>> OnSuccess = [=](TArray<FSession> Response)
    {
        //Response is a list of Sessions
    };
    const FFailureCallback OnFailure = [=](const FSequenceError& Error)
    {
        UE_LOG(LogTemp,Display,TEXT("Error Message: %s"),*Error.Message);
    };
    const TOptional<USequenceWallet*> WalletOptional = USequenceWallet::Get();
    if (WalletOptional.IsSet() && WalletOptional.GetValue())
    {
        USequenceWallet * Api = WalletOptional.GetValue();
        Api->ListSessions(OnSuccess,OnFailure);
    }
    ```
  </Tab>
</Tabs>
