GooglePlayInstant/Editor/QuickDeploy/OAuth2Credentials.cs
/// <summary>
/// Returns a Credentials instance containing credentials from the path specified in Quick Deploy
/// configurations.
/// <see cref="https://console.cloud.google.com/apis/credentials"/>
/// </summary>
/// <exception cref="Exception">Exception thrown if the file cannot be parsed as a valid OAuth2 client ID file.
/// </exception>
Returns a Credentials instance containing credentials from the path specified in Quick Deploy
configurations.
Returns a Credentials instance containing credentials from the path specified in Quick Deploy configurations .
public static Credentials GetCredentials()
        {
            var credentialsFilePath = QuickDeployWindow.Config.CloudCredentialsFileName;
            var credentialsFile = JsonUtility.FromJson<CredentialsFile>(File.ReadAllText(credentialsFilePath));
            var credentials = credentialsFile.installed;
            if (string.IsNullOrEmpty(credentials.auth_uri))
            {
                throw new ArgumentException(string.Format(
                    "File at \"{0}\" is not a valid OAuth 2.0 credentials file for installed application. Please" +
                    " visit \"https://console.cloud.google.com/apis/credentials\" to create a valid OAuth 2.0 " +
                    "credentials file for your project.", credentialsFilePath));
            }
            return credentials;
        }
public static Credentials GetCredentials ( ) { var credentialsFilePath = QuickDeployWindow . Config . CloudCredentialsFileName ; var credentialsFile = JsonUtility . FromJson < CredentialsFile > ( File . ReadAllText ( credentialsFilePath ) ) ; var credentials = credentialsFile . installed ; if ( string . IsNullOrEmpty ( credentials . auth_uri ) ) { throw new ArgumentException ( string . Format ( " \" \" " + " \" \" " + " " , credentialsFilePath ) ) ; } return credentials ; }
Returns a Credentials instance containing credentials from the path specified in Quick Deploy
configurations.
Returns a Credentials instance containing credentials from the path specified in Quick Deploy configurations .
// This will throw ArgumentException if the File is not a well-formed JSON file. // Objects returned by JsonUtility.FromJson() are never null. Therefore, to detect whether the file was of // the expected type check that one field is not null or empty.
Exception thrown if the file cannot be parsed as a valid OAuth2 client ID file.
Exception thrown if the file cannot be parsed as a valid OAuth2 client ID file .