Class AuthenticationPolicy

  • All Implemented Interfaces:
    com.azure.core.http.policy.HttpPipelinePolicy

    public class AuthenticationPolicy
    extends com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy
    Rewrite the BearerTokenAuthenticationPolicy, it will use default scope when scopes parameter is empty.
    • Constructor Summary

      Constructors 
      Constructor Description
      AuthenticationPolicy​(com.azure.core.credential.TokenCredential credential, com.azure.core.management.AzureEnvironment environment, String... scopes)
      Creates AuthenticationPolicy.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String[] getScopes​(com.azure.core.http.HttpPipelineCallContext context, String[] scopes)  
      • Methods inherited from class com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy

        authorizeRequest, authorizeRequestOnChallenge
      • Methods inherited from class com.azure.core.http.policy.BearerTokenAuthenticationPolicy

        process, setAuthorizationHeader
      • Methods inherited from interface com.azure.core.http.policy.HttpPipelinePolicy

        getPipelinePosition
    • Constructor Detail

      • AuthenticationPolicy

        public AuthenticationPolicy​(com.azure.core.credential.TokenCredential credential,
                                    com.azure.core.management.AzureEnvironment environment,
                                    String... scopes)
        Creates AuthenticationPolicy.
        Parameters:
        credential - the token credential to authenticate the request
        environment - the environment with endpoints for authentication
        scopes - the scopes used in credential, using default scopes when empty
    • Method Detail

      • getScopes

        public String[] getScopes​(com.azure.core.http.HttpPipelineCallContext context,
                                  String[] scopes)
        Overrides:
        getScopes in class com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy