Class AadResourceServerWebSecurityConfigurerAdapter

java.lang.Object
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
com.azure.spring.cloud.autoconfigure.aad.AadResourceServerWebSecurityConfigurerAdapter
All Implemented Interfaces:
org.springframework.security.config.annotation.SecurityConfigurer<javax.servlet.Filter,org.springframework.security.config.annotation.web.builders.WebSecurity>, org.springframework.security.config.annotation.web.WebSecurityConfigurer<org.springframework.security.config.annotation.web.builders.WebSecurity>
Direct Known Subclasses:
AadResourceServerConfiguration.DefaultAadResourceServerWebSecurityConfigurerAdapter

public abstract class AadResourceServerWebSecurityConfigurerAdapter extends org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
Abstract configuration class, used to make JwtConfigurer and AADJwtBearerTokenAuthenticationConverter take effect.
See Also:
  • WebSecurityConfigurerAdapter
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance with the default configuration.
    AadResourceServerWebSecurityConfigurerAdapter(AadResourceServerProperties properties, org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>> jwtGrantedAuthoritiesConverter)
    Sets the Azure AD properties and custom granted authority converter to creates a new instance, the custom granted authority converter can be null.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
    Apply the OAuth2ResourceServerConfigurer for Azure AD OAuth2 Resource Server scenario.
    protected org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>>
    Customize the Jwt granted authority converter, and return the jwtGrantedAuthoritiesConverter by default.

    Methods inherited from class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter

    authenticationManager, authenticationManagerBean, configure, configure, getApplicationContext, getHttp, init, setApplicationContext, setAuthenticationConfiguration, setContentNegotationStrategy, setObjectPostProcessor, setTrustResolver, userDetailsService, userDetailsServiceBean

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AadResourceServerWebSecurityConfigurerAdapter

      public AadResourceServerWebSecurityConfigurerAdapter()
      Creates a new instance with the default configuration.
    • AadResourceServerWebSecurityConfigurerAdapter

      public AadResourceServerWebSecurityConfigurerAdapter(AadResourceServerProperties properties, org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>> jwtGrantedAuthoritiesConverter)
      Sets the Azure AD properties and custom granted authority converter to creates a new instance, the custom granted authority converter can be null.
      Parameters:
      properties - the Azure AD properties for Resource Server
      jwtGrantedAuthoritiesConverter - the custom converter for JWT granted authority
  • Method Details

    • configure

      protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Apply the OAuth2ResourceServerConfigurer for Azure AD OAuth2 Resource Server scenario.
      Overrides:
      configure in class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
      Parameters:
      http - the HttpSecurity to use
      Throws:
      Exception - Configuration failed
    • jwtGrantedAuthoritiesConverter

      protected org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>> jwtGrantedAuthoritiesConverter()
      Customize the Jwt granted authority converter, and return the jwtGrantedAuthoritiesConverter by default.
      Returns:
      the Jwt granted authority converter.