Page Summary
-
AuthResponse represents the response from Play Games Services for server-side OAuth 2.0 authorization.
-
This response includes an OAuth 2.0 authorization code and a list of granted scopes.
-
The authorization code is a short-lived credential for your server to exchange for access and refresh tokens.
-
The granted scopes list shows permissions the user consented to, which can be empty if no consent was given or previously granted.
Represents the response received from Play Games Services when requesting a server-side OAuth 2.0 authorization code for the signed-in player.
This response provides credentials and information intended for your server to enable server-side interaction with Play Games Services web APIs on behalf of the player. It includes:
The OAuth 2.0 authorization code
: A short-lived credential to be sent securely to your server.
Your server can exchange this code for access and refresh tokens, enabling server-side API
calls.
The list of granted scopes
: A list of the AuthScope
permissions the user explicitly granted consent for (or previously approved). The list will
be empty if the user declines consent and none of the requested AuthScope
were previously granted.
Public Constructor Summary
AuthResponse
with the provided granted scopes and
authentication code.Public Method Summary
| boolean | |
| String | |
| List < AuthScope > | |
| int | hashCode
()
|
| String | toString
()
|
Inherited Method Summary
Public Constructors
public AuthResponse ( String authCode, List < AuthScope > grantedScopes)
Constructs an AuthResponse
with the provided granted scopes and
authentication code.
Parameters
| authCode | The authentication code. |
|---|---|
| grantedScopes | A list of AuthScope
objects representing the granted scopes. Must not be null. |
Throws
grantedScopes
is null.Public Methods
public boolean equals ( Object o)
public String getAuthCode ()
Returns the OAuth 2.0 authorization code.
This code is a short-lived credential that should be sent securely to your server to be exchanged for an access token and conditionally a refresh token. The access token may then be used by your server to access the Play Games Services web APIs.
Returns
- A
@NonNullstring containing the OAuth 2.0 authorization code.

