> ## Documentation Index
> Fetch the complete documentation index at: https://sequence-0fb8d9e6-6256-forte-config.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Unreal セッション管理

> Sequence インフラスタックを用いた web3 ゲーム向け Unreal SDK API のセッション管理に関するドキュメントです。

## IDトークンの取得

よくあるユースケースとして、アプリクライアントでログイン処理が完了した後、バックエンドでユーザーの本人確認を行う場合があります。
ユーザーから Sequence Id トークンを取得し、任意の JWKS ライブラリでバックエンド検証用に送信してください。
詳細は [バックエンド検証ガイド](/sdk/headless-wallet/verification) をご覧ください。

<Tabs>
  <Tab title="ブループリント">
    <Frame>
      <img src="https://mintcdn.com/sequence-0fb8d9e6-6256-forte-config/IkIHWgjd4GL119v-/images/unreal/get_id_token.png?fit=max&auto=format&n=IkIHWgjd4GL119v-&q=85&s=14ab96fbe6751c6e2b418ef158a15faa" width="2118" height="1198" data-path="images/unreal/get_id_token.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    const TFunction<void (FSeqIdTokenResponse_Data)> OnApiSuccess = [OnSuccess](const FSeqIdTokenResponse_Data& Data) { };
    const TFunction<void (FSequenceError)> OnApiFailure = [OnFailure](const FSequenceError& Err) { };

    USequenceWallet* Wallet = NewObject<USequenceWallet>();
    Wallet->GetIdToken(Nonce, OnApiSuccess, OnApiFailure);
    ```
  </Tab>
</Tabs>

## 既存セッションの確認

クライアントに既存のセッションが保存されているか確認します。

<Tabs>
  <Tab title="ブループリント">
    <Frame>
      <img src="https://mintcdn.com/sequence-0fb8d9e6-6256-forte-config/sqpnUgwrz3LSdY1A/images/unreal/check_existing_session.png?fit=max&auto=format&n=sqpnUgwrz3LSdY1A&q=85&s=eea97cca6a5c9351de67d5e9a0cbdbcc" width="2242" height="1184" data-path="images/unreal/check_existing_session.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    USequenceSessions* Sessions = NewObject<USequenceSessions>();
    const bool Exists = Sessions->CheckExistingSession();
    ```
  </Tab>
</Tabs>

## サインアウト

認証情報キャッシュをクリアし、現在のユーザーをサインアウトします。

<Tabs>
  <Tab title="ブループリント">
    <Frame>
      <img src="https://mintcdn.com/sequence-0fb8d9e6-6256-forte-config/UyC2WO2yyskLI4IH/images/unreal/sign_out.png?fit=max&auto=format&n=UyC2WO2yyskLI4IH&q=85&s=99d6614b3deee9bb6fb5682fc71476c4" width="2242" height="1184" data-path="images/unreal/sign_out.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    USequenceWallet* Wallet = NewObject<USequenceWallet>();
    Wallet->SignOut();
    ```
  </Tab>
</Tabs>

## セッション一覧取得

アクティブなセッションを一覧表示します。

<Tabs>
  <Tab title="ブループリント">
    <Frame>
      <img src="https://mintcdn.com/sequence-0fb8d9e6-6256-forte-config/UyC2WO2yyskLI4IH/images/unreal/list_sessions.png?fit=max&auto=format&n=UyC2WO2yyskLI4IH&q=85&s=8cc3f8e508b0385dcda96ef21a442d46" width="2242" height="1184" data-path="images/unreal/list_sessions.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    const TFunction<void (TArray<FSeqListSessions_Session>)> OnApiSuccess = [OnSuccess](const TArray<FSeqListSessions_Session>& Sessions) { };
    const TFunction<void (FSequenceError)> OnApiFailure = [OnFailure](const FSequenceError& Err) { };

    USequenceWallet* Wallet = NewObject<USequenceWallet>();
    Wallet->GetIdToken(Nonce, OnApiSuccess, OnApiFailure);
    ```
  </Tab>
</Tabs>

## アカウント一覧の取得

アカウント一覧の取得

<Tabs>
  <Tab title="ブループリント">
    <Frame>
      <img src="https://mintcdn.com/sequence-0fb8d9e6-6256-forte-config/UyC2WO2yyskLI4IH/images/unreal/list_accounts.png?fit=max&auto=format&n=UyC2WO2yyskLI4IH&q=85&s=fd2ed8f1c6537d9b6fe82b617be2b247" width="2242" height="1184" data-path="images/unreal/list_accounts.png" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    const TFunction<void (FSeqListAccountsResponse_Data)> OnApiSuccess = [OnSuccess](const FSeqListAccountsResponse_Data& Sessions) { };
    const TFunction<void (FSequenceError)> OnApiFailure = [OnFailure](const FSequenceError& Err) { };

    USequenceWallet* Wallet = NewObject<USequenceWallet>();
    Wallet->GetIdToken(Nonce, OnApiSuccess, OnApiFailure);
    ```
  </Tab>
</Tabs>
