Class UAuthenticationBlueprintApi

Declaration
UCLASS()
class UAuthenticationBlueprintApi : public UBlueprintFunctionLibrary

Delegates

FAuthenticationResponseDelegate

Declaration
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationResponseDelegate, FAuthenticationResponse, Response)
Return Type

FAuthenticationResponse

FAuthenticationStateChangedResponseDelegate

Declaration
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationStateChangedResponseDelegate, FAuthenticationStateChangedResponse, Response)
Return Type

FAuthenticationStateChangedResponse

FAuthenticationGetUserDelegate

Declaration
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationGetUserDelegate, FAuthenticationUserResponse, Response)
Return Type

FAuthenticationUserResponse

FAuthenticationDeleteUserDelegate

Declaration
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationDeleteUserDelegate, bool, bResponse)
Return Type

Boolean

FAuthenticationPlayerProfileChangedResponseDelegate

Declaration
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationPlayerProfileChangedResponseDelegate, FAuthenticationPlayerProfileChangedResponse, Response)
Return Type

FAuthenticationPlayerProfileChangedResponse

FAuthenticationPlayerProfileDeletedResponseDelegate

Declaration
DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationPlayerProfileDeletedResponseDelegate, FAuthenticationPlayerProfileDeletedResponse, Response)
Return Type

FAuthenticationPlayerProfileDeletedResponse

Methods

Sign In Anonymously

Signs in the current user anonymously. No credentials are required and the session is confined to the current device.

Declaration
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static void SignInAnonymously(FAuthenticationSignInOptions Options, FAuthenticationResponseDelegate ResponseDelegate)
Parameters
NameTypeDescription
OptionsFAuthenticationSignInOptionsOptions for sign-in.
Response DelegateFAuthenticationResponseDelegateDelegate that executes when the API has returned a response.

Get User Info

Returns the current player's player info, such as account creation time and linked external ids.

Declaration
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
void GetUserInfo(FAuthenticationGetUserDelegate ResponseDelegate) const
Parameter
NameTypeDescription
Response DelegateFAuthenticationGetUserDelegateDelegate that executes when the API has returned a response.

Delete User

Deletes the currently signed in user permanently.

Declaration
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static void DeleteUser(FAuthenticationDeleteUserDelegate ResponseDelegate)
Parameter
NameTypeDescription
Response DelegateFAuthenticationDeleteUserDelegateDelegate that executes when the API has returned a response.

Register State Changed Callback

Hooks into a delegate that executes upon the authentication state changing.

Declaration
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static void RegisterStateChangedCallback(FAuthenticationStateChangedResponseDelegate ResponseDelegate)
Parameter
NameTypeDescription
Response DelegateFAuthenticationStateChangedResponseDelegateDelegate that executes upon the authentication state changing.

Sign Out

Signs-out the current user under the provided profile name.

Declaration
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static bool SignOut(bool bClearCredentials = false)
Parameter
NameTypeDescription
Clear CredentialsBooleanOption to clear the session token that enables logging in to the same account.

Switch Profile

Switches the current profile to a new profile name. If a profile was not found under that name, a new one is created.

Declaration
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
void SwitchProfile(FString ProfileName)
Parameters
NameTypeDescription
Profile NameStringThe name of the profile to switch to, or add if it does not yet exist.

Profile Exists

Check if a profile exists.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool ProfileExists(FString ProfileName) const
Parameters
NameTypeDescription
Profile NameStringThe name of the profile to check.

Get Current Profile Name

Returns the name of the current profile.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FString GetCurrentProfileName() const
Returns
TypeDescription
StringThe name of the current profile.

Get Profile Names

Returns all active player profile names.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
TArray<FString> GetProfileNames() const
Returns
TypeDescription
Array of StringAll the active player profile names.

Register Profile Changed Callback

Hooks into a Handler that executes upon the player profile changing.

Declaration
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
void RegisterProfileChangedCallback(FAuthenticationPlayerProfileChangedResponseDelegate ResponseDelegate)
Parameters
NameTypeDescription
Response DelegateFAuthenticationPlayerProfileChangedResponseDelegateHandler that executes upon the player profile changing.

Register Profile Deleted Callback

Hooks into a Handler that executes upon a player profile getting deleted.

Declaration
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
void RegisterProfileDeletedCallback(FAuthenticationPlayerProfileDeletedResponseDelegate ResponseDelegate)
Parameter
NameTypeDescription
Response DelegateFAuthenticationPlayerProfileDeletedResponseDelegateHandler that executes upon a player profile getting deleted.

IsSignedIn

Checks whether the user is signed in or not.

A user can remain signed in but have an expired session.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool IsSignedIn() const
Returns
TypeDescription
boolTrue if user is signed in, else false.

IsAnonymous

Checks whether the user is signed in anonymously.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool IsAnonymous() const
Returns
TypeDescription
boolTrue if user is signed in anonymously, else false.

IsAuthorized

Checks whether the user is still authorized.

A user is authorized as long as his access token remains valid.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool IsAuthorized() const
Returns
TypeDescription
boolTrue if user is authorized, else false.

IsExpired

Checks whether the user session is expired.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool IsExpired() const
Returns
TypeDescription
boolTrue if user's session expired, else false.

SessionTokenExists

Checks if there is an existing session token stored for the current profile.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
bool SessionTokenExists() const
Returns
TypeDescription
boolTrue if there is an existing session token stored for the current profile.

GetUnityProjectId

Returns the Unity project Id.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FGuid GetUnityProjectId() const
Returns
TypeDescription
GuidThe Unity project Id.

GetUnityEnvironmentName

Returns the Unity environment name.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FString GetUnityEnvironmentName() const
Returns
TypeDescription
StringThe Unity environment name.

GetAccessToken

Returns the current user's access token.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FString GetAccessToken() const
Returns
TypeDescription
StringA string of current user's access token when they are signed in, otherwise an empty string.

GetSessionToken

Returns the current user's session token.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FString GetSessionToken() const
Returns
TypeDescription
StringA string of current user's session token when they are signed in, otherwise an empty string.

GetUserId

The current user's Id when they are signed in.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
FString GetUserId() const
Returns
TypeDescription
StringThe current user's Id when they are signed in, otherwise an empty string.

GetState

The current state of the authentication subsystem.

Declaration
UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")
EAuthenticationStates GetState() const
Returns
TypeDescription
Authentication StatesThe current state of the authentication subsystem.

GetState

Sets the Unity Project Id.

Declaration
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static void SetUnityProjectId(FGuid Value)
Parameters
NameTypeDescription
ValueGuidThe new Unity Project Id.

SetUnityEnvironmentName

Sets the Unity Environment name.

Declaration
UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")
static void SetUnityEnvironmentName(FString Value)
Parameters
NameTypeDescription
ValueStringThe new Unity Environment Id.