AuthorizeFederation
public BackendReturnObject AuthorizeFederation(string federationToken, FederationType type);
Parameters
Value | Type | Description |
---|---|---|
federationToken | string | Federation token |
type | Federation type(enum) | The federation's type.Google , Facebook , or Apple |
Description
An attempt is made to sign up or log in using the member information token value of Google/Apple/Facebook.
- If the user has no history of signing up with the token, a login is attempted at the same time as the sign-up.
- If the user has a history of signing up with the token, a login is attempted.
Example
Synchronous
Backend.MultiCharacter.Account.AuthorizeFederation("federationToken" , FederationType.Google);
Asynchronous
Backend.MultiCharacter.Account.AuthorizeFederation("federationToken" , FederationType.Google, callback =>
{
// Process after federation authentication
});
SendQueue
SendQueue.Enqueue(Backend.MultiCharacter.Account.AuthorizeFederation, "federationToken" , FederationType.Google, callback =>
{
// Process after federation authentication
});
ReturnCase
Success cases
When the login succeeds
statusCode : 200
When signing up as a new member is successful
statusCode : 201
Error cases
When the device information is 'null'
statusCode : 400
errorCode : UndefinedParameterException
When the account is blocked
statusCode : 403
errorCode : Reason for blocking entered in the console
When the device is blocked
statusCode : 403
errorCode : ForbiddenException
When withdrawal is in progress (after calling the WithdrawAccount method)
statusCode : 410
errorCode : GoneResourceException
When the withdrawal is completed, the new sign-up takes place as 201.
Federation account logout
If you want to log out from the currently logged in federation account and switch to another federation user,
you must log out from the BACKND account and then log out from the federation account to properly log in to another federation account.
After logging in to another federation account, you must call the AuthorizeFederation
method to the BACKND account again to successfully play a game with the new account.
How to log out from GPGS
public void GoogleSignout(){
GoogleSignIn.DefaultInstance.SignOut();
}
How to log out from Facebook
public void FacebookLogOut(){
FB.LogOut();
}