Class AuthenticationPolicy

java.lang.Object
com.azure.core.http.policy.BearerTokenAuthenticationPolicy
com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy
com.azure.resourcemanager.resources.fluentcore.policy.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

    Modifier and Type
    Method
    Description
    getScopes(com.azure.core.http.HttpPipelineCallContext context, String[] scopes)
     

    Methods inherited from class com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy

    authorizeRequest, authorizeRequestOnChallenge, authorizeRequestOnChallengeSync, authorizeRequestSync

    Methods inherited from class com.azure.core.http.policy.BearerTokenAuthenticationPolicy

    process, processSync, setAuthorizationHeader, setAuthorizationHeaderSync

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.core.http.policy.HttpPipelinePolicy

    getPipelinePosition
  • Constructor Details

    • 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 Details

    • getScopes

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