ApiKeyAuthenticationPolicy
A PipelinePolicy that uses an ApiKeyCredential
to set a value on a PipelineRequest to authenticate with the
cloud service.
public static ApiKeyAuthenticationPolicy CreateBasicAuthorizationPolicy(ApiKeyCredential credential)
Create a new instance of the ApiKeyAuthenticationPolicy
class, where the credential value will be set in the Authorization
header on the PipelineRequest with a Basic prefix.
public static ApiKeyAuthenticationPolicy CreateBearerAuthorizationPolicy(ApiKeyCredential credential)
Create a new instance of the ApiKeyAuthenticationPolicy
class, where the credential value will be set in the Authorization
header on the PipelineRequest with a Bearer prefix.
public static ApiKeyAuthenticationPolicy CreateHeaderApiKeyPolicy(ApiKeyCredential credential, string headerName, string keyPrefix = null)
Create a new instance of the ApiKeyAuthenticationPolicy
class, where the credential value will be specified in a request header.