Class AadResourceServerConfiguration

java.lang.Object
com.azure.spring.cloud.autoconfigure.aad.configuration.AadResourceServerConfiguration

@Configuration(proxyBeanMethods=false) @Conditional(com.azure.spring.cloud.autoconfigure.aad.implementation.conditions.ResourceServerCondition.class) public class AadResourceServerConfiguration extends Object

The configuration will not be activated if no BearerTokenAuthenticationToken class provided.

By default, creating a JwtDecoder through JwkKeySetUri will be auto-configured.
  • Constructor Details

    • AadResourceServerConfiguration

      public AadResourceServerConfiguration(org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder)
      Creates a new instance of AadResourceServerConfiguration.
      Parameters:
      restTemplateBuilder - the RestTemplateBuilder
  • Method Details

    • jwtDecoder

      @Bean @ConditionalOnMissingBean(org.springframework.security.oauth2.jwt.JwtDecoder.class) public org.springframework.security.oauth2.jwt.JwtDecoder jwtDecoder(AadAuthenticationProperties aadAuthenticationProperties)
      Use JwkKeySetUri to create JwtDecoder
      Parameters:
      aadAuthenticationProperties - the AAD properties
      Returns:
      Get the jwtDecoder instance
    • createDefaultValidator

      public List<org.springframework.security.oauth2.core.OAuth2TokenValidator<org.springframework.security.oauth2.jwt.Jwt>> createDefaultValidator(AadAuthenticationProperties aadAuthenticationProperties)
      Creates a default validator.
      Parameters:
      aadAuthenticationProperties - the AAD properties
      Returns:
      a default validator