Java Code Examples for org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter

The following examples show how to use org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter. These examples are extracted from open source projects. 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 Project: feast   Source File: DefaultJwtAuthenticationProvider.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * @param options String K/V pair of options to initialize the AuthenticationProvider with. Only
 *     one option is currently configurable, the jwkEndpointURI.
 */
public DefaultJwtAuthenticationProvider(Map<String, String> options) {
  // Endpoint used to retrieve certificates to validate JWT token
  String jwkEndpointURI = options.get("jwkEndpointURI");

  // Provide a custom endpoint to retrieve certificates
  authProvider =
      new JwtAuthenticationProvider(NimbusJwtDecoder.withJwkSetUri(jwkEndpointURI).build());
  authProvider.setJwtAuthenticationConverter(new JwtAuthenticationConverter());
}
 
Example 2
Source Project: grpc-spring-boot-starter   Source File: SecurityConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
JwtAuthenticationConverter jwtAuthenticationConverter() {
    final JwtAuthenticationConverter converter = new JwtAuthenticationConverter();
    converter.setJwtGrantedAuthoritiesConverter(keyCloakGrantedAuthoritiesConverter());
    return converter;
}
 
Example 3
Source Project: grpc-spring-boot-starter   Source File: SecurityConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
JwtAuthenticationConverter jwtAuthenticationConverter() {
    final JwtAuthenticationConverter converter = new JwtAuthenticationConverter();
    converter.setJwtGrantedAuthoritiesConverter(keyCloakGrantedAuthoritiesConverter());
    return converter;
}