Skip to main content
Version: 5.17.0

ChangeToFederation

public BackendReturnObject ChangeToFederation(string federationToken, FederationType type);

Parameters

ValueTypeDescription
federationTokenstringFederation access token
typeFederationType(enum)Federation type.
FederationType.Google
FederationType.Facebook
FederationType.Apple
FederationType.Steam
FederationType.GPGS2

Description

The BACKND SDK provides a feature to change an account registered via federation to another federation account.\ After a user who signed up via federation logs in, they can call the ChangeToFederation method to switch to a different federation account.\ After switching, the user can log in with the newly linked federation account and continue using their existing game data.\ If the user logs in again with their previous custom or federation account, a new account will be created.\ For more information on federationToken and type required for the ChangeToFederation method, please refer to the Federation authentication documentation.

Example

Synchronous

BackendReturnObject bro = Backend.BMember.ChangeToFederation("federationToken", FederationType.Google);
if(bro.IsSuccess())
{
Debug.Log("Login type changed successfully");
}

Asynchronous

Backend.BMember.ChangeToFederation("federationToken", FederationType.Google , callback => {
if(callback.IsSuccess())
{
Debug.Log("Login type changed successfully");
}
});

SendQueue

SendQueue.Enqueue(Backend.BMember.ChangeToFederation,  "federationToken", FederationType.Google, callback => {
if(callback.IsSuccess())
{
Debug.Log("Login type changed successfully");
}
});

ReturnCase

Success cases

When the switching is successful\ statusCode : 204\ message : Success

Error cases

When the attempt was made without doing customLogin\ statusCode : 400\ errorCode : UndefinedParameterException\ message : undefined access_token, access_token cannot be checked

When the token value used to switch to federation account was sent as null\ statusCode : 400\ errorCode : UndefinedParameterException\ message : undefined federation_access_token, federation_access_token cannot be checked

When there is an attempt to change the custom ID that is already signed up as a federation account\ statusCode : 409\ errorCode : DuplicatedParameterException\ message : Duplicated federationId, Duplicated federationId