Class AadResourceServerHttpSecurityConfigurer

java.lang.Object
org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,B>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<AadResourceServerHttpSecurityConfigurer,org.springframework.security.config.annotation.web.builders.HttpSecurity>
com.azure.spring.cloud.autoconfigure.aad.AadResourceServerHttpSecurityConfigurer
All Implemented Interfaces:
org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>

public class AadResourceServerHttpSecurityConfigurer extends org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<AadResourceServerHttpSecurityConfigurer,org.springframework.security.config.annotation.web.builders.HttpSecurity>
HTTP security configurer class for Azure Active Directory resource server scenario, used to make OAuth2ResourceServerConfigurer.JwtConfigurer and AadJwtGrantedAuthoritiesConverter take effect.
  • Constructor Details

    • AadResourceServerHttpSecurityConfigurer

      public AadResourceServerHttpSecurityConfigurer()
  • Method Details

    • init

      public void init(org.springframework.security.config.annotation.web.builders.HttpSecurity builder) throws Exception
      Specified by:
      init in interface org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
      Overrides:
      init in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,org.springframework.security.config.annotation.web.builders.HttpSecurity>
      Throws:
      Exception
    • aadResourceServer

      public static AadResourceServerHttpSecurityConfigurer aadResourceServer()
      Default configurer for Resource Server with Azure AD.
      Returns:
      the configurer instance to customize the SecurityConfigurer
    • jwtGrantedAuthoritiesConverter

      public AadResourceServerHttpSecurityConfigurer jwtGrantedAuthoritiesConverter(org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>> jwtGrantedAuthoritiesConverter)
      Custom a JWT granted authority converter.
      Parameters:
      jwtGrantedAuthoritiesConverter - the custom converter
      Returns:
      the AadResourceServerHttpSecurityConfigurer for further customizations