Class GoogleClientSecrets (1.60.0)

public sealed class GoogleClientSecrets

OAuth 2.0 client secrets model as specified in https://cloud.google.com/console/.

Inheritance

object > GoogleClientSecrets

Namespace

GoogleApisAuthOAuth2

Assembly

Google.Apis.Auth.dll

Properties

Secrets

public ClientSecrets Secrets { get; }

Gets the client secrets which contains the client identifier and client secret.

Property Value
Type Description
ClientSecrets

Methods

FromFile(string)

public static GoogleClientSecrets FromFile(string clientSecretsFilePath)

Loads the Google client secret from a JSON file.

Parameter
Name Description
clientSecretsFilePath string
Returns
Type Description
GoogleClientSecrets

FromFileAsync(string, CancellationToken)

public static Task<GoogleClientSecrets> FromFileAsync(string clientSecretsFilePath, CancellationToken cancellationToken = default)

Asynchronously loads the Google client secret from a JSON file.

Parameters
Name Description
clientSecretsFilePath string
cancellationToken CancellationToken
Returns
Type Description
TaskGoogleClientSecrets

FromStream(Stream)

public static GoogleClientSecrets FromStream(Stream stream)

Loads the Google client secret from the input stream.

Parameter
Name Description
stream Stream
Returns
Type Description
GoogleClientSecrets

FromStreamAsync(Stream, CancellationToken)

public static Task<GoogleClientSecrets> FromStreamAsync(Stream stream, CancellationToken cancellationToken = default)

Asynchronously loads the Google client secret from the input stream.

Parameters
Name Description
stream Stream
cancellationToken CancellationToken
Returns
Type Description
TaskGoogleClientSecrets

Load(Stream)

[Obsolete("Please use GoogleClientSecrets.FromStream which is an equivalent alternative.")]
public static GoogleClientSecrets Load(Stream stream)

Loads the Google client secret from the input stream.

Parameter
Name Description
stream Stream
Returns
Type Description
GoogleClientSecrets
Remarks

This method has been made obsolete in favour of FromStream(Stream) which only differs in name.

Extension Method