Stay organized with collections
Save and categorize content based on your preferences.
GooglePlayGames.BasicApi.AuthResponse
Represents the response received from Play Games Services when requesting a server-side OAuth 2.0 authorization code for the signed-in player.
Summary
Constructors and Destructors
|
AuthResponse(string authCode, List< AuthScope > grantedScopes)
Constructs an AuthResponse with the provided granted scopes and authentication code.
|
Public functions
AuthResponse
AuthResponse(
string authCode,
List< AuthScope > grantedScopes
)
Constructs an AuthResponse
with the provided granted scopes and authentication code.
Details |
Parameters |
authCode
|
The authentication code.
|
grantedScopes
|
A list of AuthScope objects representing the granted scopes.
|
|
Exceptions |
ArgumentNullException
|
If grantedScopes is null.
|
|
Equals
override bool Equals(
object obj
)
GetAuthCode
string GetAuthCode()
Gets 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.
Details |
Returns
|
A string containing the OAuth 2.0 authorization code.
|
GetGrantedScopes
List< AuthScope > GetGrantedScopes()
Gets the list of AuthScope
permissions that the user has granted.
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.
Details |
Returns
|
A List of AuthScope objects, representing the granted permissions.
|
GetHashCode
override int GetHashCode()
ToString
override string ToString()
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-07-08 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-08 UTC."],[],[],null,["# GooglePlayGames.BasicApi.AuthResponse Class Reference\n\nGooglePlayGames.BasicApi.AuthResponse\n=====================================\n\nRepresents the response received from Play Games Services when requesting a server-side OAuth 2.0 authorization code for the signed-in player.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [AuthResponse](#class_google_play_games_1_1_basic_api_1_1_auth_response_1a5c4d958ab85760c1ac31ab45507f88f4)`(string authCode, List\u003c `[AuthScope](/games/services/unity/v2/api/namespace/google-play-games/basic-api#namespace_google_play_games_1_1_basic_api_1ab5415b6b4ad0724108f447b203380e44)` \u003e grantedScopes)` Constructs an [AuthResponse](/games/services/unity/v2/api/class/google-play-games/basic-api/auth-response#class_google_play_games_1_1_basic_api_1_1_auth_response) with the provided granted scopes and authentication code. ||\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Equals](#class_google_play_games_1_1_basic_api_1_1_auth_response_1a39a2403f5f1dcc8de41d6402b3d9af08)`(object obj)` | `override bool` |\n| [GetAuthCode](#class_google_play_games_1_1_basic_api_1_1_auth_response_1af868a26d44d39e244eb16418595a43dc)`()` | `string` Gets the OAuth 2.0 authorization code. |\n| [GetGrantedScopes](#class_google_play_games_1_1_basic_api_1_1_auth_response_1ae07475d535461a7ae0f36b74e9ffc494)`()` | `List\u003c `[AuthScope](/games/services/unity/v2/api/namespace/google-play-games/basic-api#namespace_google_play_games_1_1_basic_api_1ab5415b6b4ad0724108f447b203380e44)` \u003e` Gets the list of `AuthScope` permissions that the user has granted. |\n| [GetHashCode](#class_google_play_games_1_1_basic_api_1_1_auth_response_1a70626483d8759bf5f9598f06be206f32)`()` | `override int` |\n| [ToString](#class_google_play_games_1_1_basic_api_1_1_auth_response_1a316944d8587f98fce033736bd129a2bb)`()` | `override string` |\n\nPublic functions\n----------------\n\n### AuthResponse\n\n```c#\n AuthResponse(\n string authCode,\n List\u003c AuthScope \u003e grantedScopes\n)\n``` \nConstructs an [AuthResponse](/games/services/unity/v2/api/class/google-play-games/basic-api/auth-response#class_google_play_games_1_1_basic_api_1_1_auth_response) with the provided granted scopes and authentication code.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |-----------------|----------------------------------------------------------------| | `authCode` | The authentication code. | | `grantedScopes` | A list of `AuthScope` objects representing the granted scopes. | |\n| Exceptions | |-------------------------|-----------------------------| | `ArgumentNullException` | If `grantedScopes` is null. | |\n\n### Equals\n\n```c#\noverride bool Equals(\n object obj\n)\n``` \n\n### GetAuthCode\n\n```c#\nstring GetAuthCode()\n``` \nGets the OAuth 2.0 authorization code.\n\nThis 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.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|-------------------------------------------------------|\n| **Returns** | A string containing the OAuth 2.0 authorization code. |\n\n### GetGrantedScopes\n\n```c#\nList\u003c AuthScope \u003e GetGrantedScopes()\n``` \nGets the list of `AuthScope` permissions that the user has granted.\n\nA 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.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|------------------------------------------------------------------------|\n| **Returns** | A `List` of `AuthScope` objects, representing the granted permissions. |\n\n### GetHashCode\n\n```c#\noverride int GetHashCode()\n``` \n\n### ToString\n\n```c#\noverride string ToString()\n```"]]