Skip to main content
Version: SDK-5.11.6

ChangeCustomToFederation

public BackendReturnObject ChangeCustomToFederation(string federationToken, FederationType type);

Parameters

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

Description

This is a function for switching the customer ID in BACKND SDK to a federation account.
Once the custom account user logs in and calls the ChangeCustomToFederation method, the user can be switched into a federation account.
For more information on federationToken and type required for ChangeCustomToFederation, please refer to the federation authentication documentation.
If email permission was not added when switching a custom account into a federation account, the custom ID is displayed as the member ID.

Example

Synchronous

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

Asynchronous

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

SendQueue

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

Return cases

Success cases

When the switching is successful
statusCode : 204
message : Success

Error cases

When ChangeCustomToFederation was completed but another attempt is made
statusCode : 400
errorCode : BadParameterException
message : bad type, Invalid type

When there is an attempt without customLogin
statusCode : 400
errorCode : UndefinedParameterException
message : undefined access_token, access_token cannot be checked

If the token value used in the federation switch 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