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
TypeDescription
ClientSecrets

Methods

FromFile(string)

public static GoogleClientSecrets FromFile(string clientSecretsFilePath)

Loads the Google client secret from a JSON file.

Parameter
NameDescription
clientSecretsFilePathstring
Returns
TypeDescription
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
NameDescription
clientSecretsFilePathstring
cancellationTokenCancellationToken
Returns
TypeDescription
TaskGoogleClientSecrets

FromStream(Stream)

public static GoogleClientSecrets FromStream(Stream stream)

Loads the Google client secret from the input stream.

Parameter
NameDescription
streamStream
Returns
TypeDescription
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
NameDescription
streamStream
cancellationTokenCancellationToken
Returns
TypeDescription
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
NameDescription
streamStream
Returns
TypeDescription
GoogleClientSecrets
Remarks

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

Extension Method