# UAuthenticationBlueprintApi クラス

> Reference the Blueprint Application Programming Interface for authentication operations.

##### 宣言##declaration

```cpp
UCLASS()
class UAuthenticationBlueprintApi : public UBlueprintFunctionLibrary
```

## デリゲート##delegates

### FAuthenticationResponseDelegate##fauthenticationresponsedelegate

#### 宣言##declaration

```cpp
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationResponseDelegate, FAuthenticationResponse, Response)
```

#### 戻り値の型##return-type

[FAuthenticationResponse](./models/authentication-response.md)

### FAuthenticationStateChangedResponseDelegate##fauthenticationstatechangedresponsedelegate

#### 宣言##declaration

```cpp
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationStateChangedResponseDelegate, FAuthenticationStateChangedResponse, Response)
```

#### 戻り値の型##return-type

[FAuthenticationStateChangedResponse](./models/authentication-state-changed-response.md)

### FAuthenticationGetUserDelegate##fauthenticationgetuserdelegate

#### 宣言##declaration

```cpp
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationGetUserDelegate, FAuthenticationUserResponse, Response)
```

#### 戻り値の型##return-type

[FAuthenticationUserResponse](./models/authentication-user-response.md)

### FAuthenticationDeleteUserDelegate##fauthenticationdeleteuserdelegate

#### 宣言##declaration

```cpp
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationDeleteUserDelegate, bool, bResponse)
```

#### 戻り値の型##return-type

Boolean

### FAuthenticationPlayerProfileChangedResponseDelegate##fauthenticationplayerprofilechangedresponsedelegate

#### 宣言##declaration

```cpp
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationPlayerProfileChangedResponseDelegate, FAuthenticationPlayerProfileChangedResponse, Response)
```

#### 戻り値の型##return-type

[FAuthenticationPlayerProfileChangedResponse](./models/authentication-player-profile-changed-response.md)

### FAuthenticationPlayerProfileDeletedResponseDelegate##fauthenticationplayerprofiledeletedresponsedelegate

#### 宣言##declaration

```cpp
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationPlayerProfileDeletedResponseDelegate, FAuthenticationPlayerProfileDeletedResponse, Response)
```

#### 戻り値の型##return-type

[FAuthenticationPlayerProfileDeletedResponse](./models/authentication-player-profile-deleted-response.md)

## メソッド##methods

### Sign In Anonymously##sign-in-anonymously

現在のユーザーを匿名でサインインします。認証情報は必要なく、セッションは現在のデバイスに限定されます。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static void SignInAnonymously(FAuthenticationSignInOptions Options, FAuthenticationResponseDelegate ResponseDelegate)
```

#### パラメーター##parameters

| **名前**            | **型**                                                                                                | **説明**                    |
| :---------------- | :--------------------------------------------------------------------------------------------------- | :------------------------ |
| オプション             | [FAuthenticationSignInOptions](./models/authentication-sign-in-options.md)                           | サインインのオプション。              |
| Response Delegate | [FAuthenticationResponseDelegate](./authentication-blueprint-api.md#fauthenticationresponsedelegate) | API が応答を返したときに実行されるデリゲート。 |

### Get User Info##get-user-info

現在のプレイヤーの情報を返します (アカウント作成日時やリンクされた外部 ID など)。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
void GetUserInfo(FAuthenticationGetUserDelegate ResponseDelegate) const
```

#### パラメーター##parameter

| **名前**            | **型**                                                                                              | **説明**                    |
| :---------------- | :------------------------------------------------------------------------------------------------- | :------------------------ |
| Response Delegate | [FAuthenticationGetUserDelegate](./authentication-blueprint-api.md#fauthenticationgetuserdelegate) | API が応答を返したときに実行されるデリゲート。 |

### Delete User##delete-user

現在サインインしているユーザーを完全に削除します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static void DeleteUser(FAuthenticationDeleteUserDelegate ResponseDelegate)
```

#### パラメーター##parameter

| **名前**            | **型**                                                                                                    | **説明**                    |
| :---------------- | :------------------------------------------------------------------------------------------------------- | :------------------------ |
| Response Delegate | [FAuthenticationDeleteUserDelegate](./authentication-blueprint-api.md#fauthenticationdeleteuserdelegate) | API が応答を返したときに実行されるデリゲート。 |

### Register State Changed Callback##register-state-changed-callback

認証状態が変更された際に実行されるデリゲートにフックします。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static void RegisterStateChangedCallback(FAuthenticationStateChangedResponseDelegate ResponseDelegate)
```

#### パラメーター##parameter

| **名前**            | **型**                                                                                                                        | **説明**                  |
| :---------------- | :--------------------------------------------------------------------------------------------------------------------------- | :---------------------- |
| Response Delegate | [FAuthenticationStateChangedResponseDelegate](./authentication-blueprint-api.md#fauthenticationstatechangedresponsedelegate) | 認証状態が変更された際に実行されるデリゲート。 |

### Sign Out##sign-out

指定されたプロファイル名で現在のユーザーをサインアウトします。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static bool SignOut(bool bClearCredentials = false)
```

#### パラメーター##parameter

| **名前**            | **型**   | **説明**                                  |
| :---------------- | :------ | :-------------------------------------- |
| Clear Credentials | Boolean | 同じアカウントへのログインを可能にするセッショントークンを消去するオプション。 |

### Switch Profile##switch-profile

現在のプロファイルを新しいプロファイル名に切り替えます。その名前のプロファイルが見つからなかった場合は、新しいプロファイルが作成されます。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
void SwitchProfile(FString ProfileName)
```

#### パラメーター##parameters

| **名前**       | **型**                                                                                                 | **説明**                                    |
| :----------- | :---------------------------------------------------------------------------------------------------- | :---------------------------------------- |
| Profile Name | [String](https://docs.unrealengine.com/5.3/en-US/blueprint-variables-in-unreal-engine/#variabletypes) | 切り替えるプロファイルの名前 (まだ存在しない場合は追加するプロファイルの名前)。 |

### Profile Exists##profile-exists

プロファイルが存在するかどうかを確認します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool ProfileExists(FString ProfileName) const
```

#### パラメーター##parameters

| **名前**       | **型**                                                                                                 | **説明**         |
| :----------- | :---------------------------------------------------------------------------------------------------- | :------------- |
| Profile Name | [String](https://docs.unrealengine.com/5.3/en-US/blueprint-variables-in-unreal-engine/#variabletypes) | 確認するプロファイルの名前。 |

### Get Current Profile Name##get-current-profile-name

現在のプロファイルの名前を返します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FString GetCurrentProfileName() const
```

#### 戻り値##returns

| **型**                                                                                                 | **説明**        |
| :---------------------------------------------------------------------------------------------------- | :------------ |
| [String](https://docs.unrealengine.com/5.3/en-US/blueprint-variables-in-unreal-engine/#variabletypes) | 現在のプロファイルの名前。 |

### Get Profile Names##get-profile-names

すべてのアクティブなプレイヤープロファイルの名前を返します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
TArray<FString> GetProfileNames() const
```

#### 戻り値##returns

| **型**                                                                                                     | **説明**                    |
| :-------------------------------------------------------------------------------------------------------- | :------------------------ |
| [String](https://docs.unrealengine.com/5.3/en-US/blueprint-variables-in-unreal-engine/#variabletypes) の配列 | すべてのアクティブなプレイヤープロファイルの名前。 |

### Register Profile Changed Callback##register-profile-changed-callback

プレイヤープロファイルが変更された際に実行されるハンドラーにフックします。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
void RegisterProfileChangedCallback(FAuthenticationPlayerProfileChangedResponseDelegate ResponseDelegate)
```

#### パラメーター##parameters

| **名前**            | **型**                                                                                                                                        | **説明**                         |
| :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------- |
| Response Delegate | [FAuthenticationPlayerProfileChangedResponseDelegate](./authentication-blueprint-api.md#fauthenticationplayerprofilechangedresponsedelegate) | プレイヤープロファイルが変更された際に実行されるハンドラー。 |

### Register Profile Deleted Callback##register-profile-deleted-callback

プレイヤープロファイルが削除された際に実行されるハンドラーにフックします。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
void RegisterProfileDeletedCallback(FAuthenticationPlayerProfileDeletedResponseDelegate ResponseDelegate)
```

#### パラメーター##parameter

| **名前**            | **型**                                                                                                                                        | **説明**                         |
| :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------- |
| Response Delegate | [FAuthenticationPlayerProfileDeletedResponseDelegate](./authentication-blueprint-api.md#fauthenticationplayerprofiledeletedresponsedelegate) | プレイヤープロファイルが削除された際に実行されるハンドラー。 |

### IsSignedIn##issignedin

ユーザーがサインインしているかどうかを確認します。

> **Note:**
>
> ユーザーはサインインしたままで、セッションが期限切れになることがあります。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool IsSignedIn() const
```

#### 戻り値##returns

| **型** | **説明**                                 |
| :---- | :------------------------------------- |
| bool  | ユーザーがサインインしている場合は true、それ以外の場合は false。 |

### IsAnonymous##isanonymous

ユーザーが匿名でサインインしているかどうかを確認します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool IsAnonymous() const
```

#### 戻り値##returns

| **型** | **説明**                                    |
| :---- | :---------------------------------------- |
| bool  | ユーザーが匿名でサインインしている場合は true、それ以外の場合は false。 |

### IsAuthorized##isauthorized

ユーザーがまだ認証されているかどうかを確認します。

> **Note:**
>
> ユーザーは、アクセストークンが有効である限り、認証された状態で維持されます。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool IsAuthorized() const
```

#### 戻り値##returns

| **型** | **説明**                               |
| :---- | :----------------------------------- |
| bool  | ユーザーが認証されている場合は true、それ以外の場合は false。 |

### IsExpired##isexpired

ユーザーセッションが期限切れかどうかを確認します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool IsExpired() const
```

#### 戻り値##returns

| **型** | **説明**                                     |
| :---- | :----------------------------------------- |
| bool  | ユーザーのセッションが期限切れである場合は true、それ以外の場合は false。 |

### SessionTokenExists##sessiontokenexists

現在のプロファイル用に保存されているセッショントークンがあるかどうかを確認します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool SessionTokenExists() const
```

#### 戻り値##returns

| **型** | **説明**                                  |
| :---- | :-------------------------------------- |
| bool  | 現在のプロファイル用に保存されているセッショントークンがある場合は true。 |

### GetUnityProjectId##getunityprojectid

Unity プロジェクト ID を返します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FGuid GetUnityProjectId() const
```

#### 戻り値##returns

| **型**                                                                        | **説明**           |
| :--------------------------------------------------------------------------- | :--------------- |
| [Guid](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Misc/FGuid/) | Unity プロジェクト ID。 |

### GetUnityEnvironmentName##getunityenvironmentname

Unity 環境名を返します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FString GetUnityEnvironmentName() const
```

#### 戻り値##returns

| **型**                                                                                                 | **説明**     |
| :---------------------------------------------------------------------------------------------------- | :--------- |
| [String](https://docs.unrealengine.com/5.3/en-US/blueprint-variables-in-unreal-engine/#variabletypes) | Unity 環境名。 |

### GetAccessToken##getaccesstoken

現在のユーザーのアクセストークンを返します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FString GetAccessToken() const
```

#### 戻り値##returns

| **型**                                                                                                 | **説明**                                            |
| :---------------------------------------------------------------------------------------------------- | :------------------------------------------------ |
| [String](https://docs.unrealengine.com/5.3/en-US/blueprint-variables-in-unreal-engine/#variabletypes) | 現在のユーザーがサインインしている場合はそのアクセストークンの文字列。それ以外の場合は空の文字列。 |

### GetSessionToken##getsessiontoken

現在のユーザーのセッショントークンを返します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FString GetSessionToken() const
```

#### 戻り値##returns

| **型**                                                                                                 | **説明**                                             |
| :---------------------------------------------------------------------------------------------------- | :------------------------------------------------- |
| [String](https://docs.unrealengine.com/5.3/en-US/blueprint-variables-in-unreal-engine/#variabletypes) | 現在のユーザーがサインインしている場合はそのセッショントークンの文字列。それ以外の場合は空の文字列。 |

### GetUserId##getuserid

現在のユーザーがサインインしている場合は、そのユーザーの ID。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FString GetUserId() const
```

#### 戻り値##returns

| **型**                                                                                                 | **説明**                                        |
| :---------------------------------------------------------------------------------------------------- | :-------------------------------------------- |
| [String](https://docs.unrealengine.com/5.3/en-US/blueprint-variables-in-unreal-engine/#variabletypes) | 現在のユーザーがサインインしている場合はそのユーザーの ID。それ以外の場合は空の文字列。 |

### GetState##getstate

認証サブシステムの現在の状態。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
EAuthenticationStates GetState() const
```

#### 戻り値##returns

| **型**                                               | **説明**          |
| :-------------------------------------------------- | :-------------- |
| [Authentication States](./authentication-states.md) | 認証サブシステムの現在の状態。 |

### GetState##getstate

Unity プロジェクト ID を設定します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static void SetUnityProjectId(FGuid Value)
```

#### パラメーター##parameters

| **名前** | **型**                                                                        | **説明**               |
| :----- | :--------------------------------------------------------------------------- | :------------------- |
| 値      | [Guid](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Misc/FGuid/) | 新しい Unity プロジェクト ID。 |

### SetUnityEnvironmentName##setunityenvironmentname

Unity 環境名を設定します。

#### 宣言##declaration

```cpp
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static void SetUnityEnvironmentName(FString Value)
```

#### パラメーター##parameters

| **名前** | **型**                                                                                                 | **説明**           |
| :----- | :---------------------------------------------------------------------------------------------------- | :--------------- |
| 値      | [String](https://docs.unrealengine.com/5.3/en-US/blueprint-variables-in-unreal-engine/#variabletypes) | 新しい Unity 環境 ID。 |
