public sealed class ProgrammaticExternalAccountCredential : ExternalAccountCredential, IHttpUnsuccessfulResponseHandler, ICredential, IConfigurableHttpClientInitializer, ITokenAccessWithHeaders, ITokenAccess, IHttpExecuteInterceptorExternal account credentials that rely on user-provided code to obtain the third-party token.
Inheritance
object > ServiceCredential > ExternalAccountCredential > ProgrammaticExternalAccountCredentialImplements
IHttpUnsuccessfulResponseHandler, ICredential, IConfigurableHttpClientInitializer, ITokenAccessWithHeaders, ITokenAccess, IHttpExecuteInterceptorNamespace
Google.Apis.Auth.OAuth2Assembly
Google.Apis.Auth.dll
Remarks
This credential type does not validate the credential configuration. A security risk occurs when a credential configuration configured with malicious urls is used. You should validate credential configurations provided by untrusted sources. See Security requirements when using credential configurations from an external source for more details.
Constructors
ProgrammaticExternalAccountCredential(Initializer)
public ProgrammaticExternalAccountCredential(ProgrammaticExternalAccountCredential.Initializer initializer)Builds a ProgrammaticExternalAccountCredential instace from the given initializer.
| Parameter | |
|---|---|
| Name | Description |
initializer |
ProgrammaticExternalAccountCredentialInitializer |
Properties
SubjectTokenProvider
public ProgrammaticExternalAccountCredential.ISubjectTokenProvider SubjectTokenProvider { get; }The provider of the third-party token that's included on the STS token exchange request. Will not be null.
| Property Value | |
|---|---|
| Type | Description |
ProgrammaticExternalAccountCredentialISubjectTokenProvider |
|
Methods
GetSubjectTokenAsyncImpl(CancellationToken)
protected override Task<string> GetSubjectTokenAsyncImpl(CancellationToken taskCancellationToken)Gets the subject token to be exchanged for the access token.
| Parameter | |
|---|---|
| Name | Description |
taskCancellationToken |
CancellationToken |
| Returns | |
|---|---|
| Type | Description |
Taskstring |
|
ToGoogleCredential()
public GoogleCredential ToGoogleCredential()Creates a GoogleCredential from this credential.
| Returns | |
|---|---|
| Type | Description |
GoogleCredential |
|