org.springframework.boot.autoconfigure.security.oauth2.resource.OAuth2ResourceServerProperties Java Examples

The following examples show how to use org.springframework.boot.autoconfigure.security.oauth2.resource.OAuth2ResourceServerProperties. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SecurityConfig.java    From spring-security-samples with MIT License 5 votes vote down vote up
@Bean
public JwtDecoder jwtDecoderByIssuerUri(OAuth2ResourceServerProperties properties) {
	String issuerUri = properties.getJwt().getIssuerUri();
	NimbusJwtDecoder jwtDecoder = (NimbusJwtDecoder) JwtDecoders.fromIssuerLocation(issuerUri);
	// Use preferred_username from claims as authentication name, instead of UUID subject
	jwtDecoder.setClaimSetConverter(new UsernameSubClaimAdapter());
	return jwtDecoder;
}
 
Example #2
Source File: SecurityConfig.java    From spring-security-samples with MIT License 5 votes vote down vote up
@Bean
public JwtDecoder jwtDecoderByIssuerUri(OAuth2ResourceServerProperties properties) {
	String issuerUri = properties.getJwt().getIssuerUri();
	NimbusJwtDecoder jwtDecoder = (NimbusJwtDecoder) JwtDecoders.fromIssuerLocation(issuerUri);
	// Use preferred_username from claims as authentication name, instead of UUID subject
	jwtDecoder.setClaimSetConverter(new UsernameSubClaimAdapter());
	return jwtDecoder;
}
 
Example #3
Source File: SecurityConfig.java    From spring-security-samples with MIT License 5 votes vote down vote up
@Bean
public JwtDecoder jwtDecoderByIssuerUri(OAuth2ResourceServerProperties properties) {
	String issuerUri = properties.getJwt().getIssuerUri();
	NimbusJwtDecoder jwtDecoder = (NimbusJwtDecoder) JwtDecoders.fromIssuerLocation(issuerUri);
	// Use preferred_username from claims as authentication name, instead of UUID subject
	jwtDecoder.setClaimSetConverter(new UsernameSubClaimAdapter());
	return jwtDecoder;
}