Class AadB2cResourceServerAutoConfiguration
java.lang.Object
com.azure.spring.cloud.autoconfigure.aadb2c.AadB2cResourceServerAutoConfiguration
@Configuration(proxyBeanMethods=false)
@ConditionalOnWebApplication(type=SERVLET)
@ConditionalOnProperty(value="spring.cloud.azure.active-directory.b2c.enabled",
havingValue="true")
@ConditionalOnClass(org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthenticationToken.class)
@Import({AadB2cPropertiesConfiguration.class,AadB2cOAuth2ClientConfiguration.class})
public class AadB2cResourceServerAutoConfiguration
extends Object
Configure necessary beans for Azure AD B2C resource server beans, and import
AadB2cOAuth2ClientConfiguration
class for Azure AD
B2C OAuth2 client support.-
Constructor Summary
ConstructorDescriptionAadB2cResourceServerAutoConfiguration
(AadB2cProperties properties, org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder) Creates a new instance ofAadB2cResourceServerAutoConfiguration
. -
Method Summary
Modifier and TypeMethodDescriptioncom.nimbusds.jwt.proc.JWTClaimsSetAwareJWSKeySelector<com.nimbusds.jose.proc.SecurityContext>
aadIssuerJwsKeySelector
(AadTrustedIssuerRepository aadTrustedIssuerRepository, com.nimbusds.jose.util.ResourceRetriever resourceRetriever) Declare JWTClaimsSetAwareJWSKeySelector bean.org.springframework.security.oauth2.jwt.JwtDecoder
jwtDecoder
(com.nimbusds.jwt.proc.JWTProcessor<com.nimbusds.jose.proc.SecurityContext> jwtProcessor, AadTrustedIssuerRepository trustedIssuerRepository) Declare JwtDecoder bean.com.nimbusds.jwt.proc.JWTProcessor<com.nimbusds.jose.proc.SecurityContext>
jwtProcessor
(com.nimbusds.jwt.proc.JWTClaimsSetAwareJWSKeySelector<com.nimbusds.jose.proc.SecurityContext> keySelector) Declare JWTProcessor bean.com.nimbusds.jose.util.ResourceRetriever
Declare JWT ResourceRetriever bean.Declare AADTrustedIssuerRepository bean.
-
Constructor Details
-
AadB2cResourceServerAutoConfiguration
public AadB2cResourceServerAutoConfiguration(AadB2cProperties properties, org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder) Creates a new instance ofAadB2cResourceServerAutoConfiguration
.- Parameters:
properties
- the Azure AD B2C propertiesrestTemplateBuilder
- the restTemplateBuilder
-
-
Method Details
-
trustedIssuerRepository
Declare AADTrustedIssuerRepository bean.- Returns:
- AADTrustedIssuerRepository bean
-
jwtResourceRetriever
@Bean @ConditionalOnMissingBean(com.nimbusds.jose.util.ResourceRetriever.class) public com.nimbusds.jose.util.ResourceRetriever jwtResourceRetriever()Declare JWT ResourceRetriever bean.- Returns:
- JWT ResourceRetriever bean
-
aadIssuerJwsKeySelector
@Bean @ConditionalOnMissingBean public com.nimbusds.jwt.proc.JWTClaimsSetAwareJWSKeySelector<com.nimbusds.jose.proc.SecurityContext> aadIssuerJwsKeySelector(AadTrustedIssuerRepository aadTrustedIssuerRepository, com.nimbusds.jose.util.ResourceRetriever resourceRetriever) Declare JWTClaimsSetAwareJWSKeySelector bean.- Parameters:
aadTrustedIssuerRepository
- the AAD trusted issuer repositoryresourceRetriever
- the resource retriever- Returns:
- JWTClaimsSetAwareJWSKeySelector bean
-
jwtProcessor
@Bean @ConditionalOnMissingBean public com.nimbusds.jwt.proc.JWTProcessor<com.nimbusds.jose.proc.SecurityContext> jwtProcessor(com.nimbusds.jwt.proc.JWTClaimsSetAwareJWSKeySelector<com.nimbusds.jose.proc.SecurityContext> keySelector) Declare JWTProcessor bean.- Parameters:
keySelector
- the JWT claims set aware JWS key selector- Returns:
- JWTProcessor bean
-
jwtDecoder
@Bean @ConditionalOnMissingBean public org.springframework.security.oauth2.jwt.JwtDecoder jwtDecoder(com.nimbusds.jwt.proc.JWTProcessor<com.nimbusds.jose.proc.SecurityContext> jwtProcessor, AadTrustedIssuerRepository trustedIssuerRepository) Declare JwtDecoder bean.- Parameters:
jwtProcessor
- the JWT processortrustedIssuerRepository
- the AAD trusted issuer repository- Returns:
- JwtDecoder bean
-