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
ConstructorsConstructorDescriptionCreates 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 TypeMethodDescriptionprotected voidconfigure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Apply theOAuth2ResourceServerConfigurerfor 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 thejwtGrantedAuthoritiesConverterby 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
-
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 ServerjwtGrantedAuthoritiesConverter- 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 theOAuth2ResourceServerConfigurerfor Azure AD OAuth2 Resource Server scenario.- Overrides:
configurein classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter- Parameters:
http- theHttpSecurityto 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 thejwtGrantedAuthoritiesConverterby default.- Returns:
- the Jwt granted authority converter.
-