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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionDefault configurer for Resource Server with Azure AD.void
init
(org.springframework.security.config.annotation.web.builders.HttpSecurity builder) 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.Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
disable, getSecurityContextHolderStrategy, withObjectPostProcessor
Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, and, configure, getBuilder, postProcess, setBuilder
-
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 interfaceorg.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,
org.springframework.security.config.annotation.web.builders.HttpSecurity> - Overrides:
init
in classorg.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,
org.springframework.security.config.annotation.web.builders.HttpSecurity> - Throws:
Exception
-
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
-