#Authentication
By default, AutoRest generates clients that make unauthenticated HTTP requests. When the -AddCredentials flag is set to true
, the generated client will include a Credentials
property of type ServiceClientCredentials. The Microsoft.Rest.ClientRuntime package includes two ServiceClientCredentials :
TokenCredentials
- used for OAuth authentication.BasicAuthenticationCredentials
- used for basic username/password authentication.
Custom authentication behaviors can be implemented by inheriting from ServiceClientCredentials. The ProcessHttpRequestAsync()
method is invoked for each HTTP request.