GooglePlayInstant/Editor/QuickDeploy/AccessTokenGetter.cs
/// <summary>
/// Sends an HTTP request to OAuth2 token uri to retrieve, process and store needed tokens.
/// </summary>
/// <param name="grantDictionary">A dictionary containing OAuth2 grant type and grant values to be used when
/// requesting access token. The dictionary will be mutated by adding more credentials values needed to
/// send the token request.</param>
/// <param name="postTokenAction"></param>
Sends an HTTP request to OAuth2 token uri to retrieve, process and store needed tokens.
Sends an HTTP request to OAuth2 token uri to retrieve process and store needed tokens .
private static void RequestToken(Dictionary<string, string> grantDictionary, Action postTokenAction)
        {
            var credentials = OAuth2Credentials.GetCredentials();
            grantDictionary.Add("client_id", credentials.client_id);
            grantDictionary.Add("client_secret", credentials.client_secret);
            WwwRequestInProgress.TrackProgress(
                HttpRequestHelper.SendHttpPostRequest(credentials.token_uri, grantDictionary, null),
                "Requesting access token",
                completeTokenRequest =>
                {
                    HandleTokenResponse(completeTokenRequest);
                    postTokenAction();
                });
        }
private static void RequestToken ( Dictionary < string , string > grantDictionary , Action postTokenAction ) { var credentials = OAuth2Credentials . GetCredentials ( ) ; grantDictionary . Add ( " " , credentials . client_id ) ; grantDictionary . Add ( " " , credentials . client_secret ) ; WwwRequestInProgress . TrackProgress ( HttpRequestHelper . SendHttpPostRequest ( credentials . token_uri , grantDictionary , null ) , " " , completeTokenRequest => { HandleTokenResponse ( completeTokenRequest ) ; postTokenAction ( ) ; } ) ; }
Sends an HTTP request to OAuth2 token uri to retrieve, process and store needed tokens.
Sends an HTTP request to OAuth2 token uri to retrieve process and store needed tokens .
grantDictionary
Dictionary<string, string>
A dictionary containing OAuth2 grant type and grant values to be used when
requesting access token. The dictionary will be mutated by adding more credentials values needed to
send the token request.
A dictionary containing OAuth2 grant type and grant values to be used when requesting access token . The dictionary will be mutated by adding more credentials values needed to send the token request .
postTokenAction
Action
None