use of io.micronaut.security.oauth2.configuration.endpoints.SecureEndpointConfiguration in project micronaut-security by micronaut-projects.
the class OauthPasswordAuthenticationProvider method getTokenEndpoint.
/**
* Builds the secure endpoint from the client configuration.
*
* @param clientConfiguration The client configuration
* @return The token endpoint
*/
protected SecureEndpoint getTokenEndpoint(OauthClientConfiguration clientConfiguration) {
SecureEndpointConfiguration endpointConfiguration = clientConfiguration.getToken().orElseThrow(() -> new IllegalArgumentException("Token endpoint configuration is missing for provider [" + clientConfiguration.getName() + "]"));
List<AuthenticationMethod> authMethodsSupported = Collections.singletonList(endpointConfiguration.getAuthMethod().orElse(AuthenticationMethod.CLIENT_SECRET_BASIC));
String url = endpointConfiguration.getUrl().orElseThrow(() -> new IllegalArgumentException("Token endpoint URL is null for provider [" + clientConfiguration.getName() + "]"));
return new DefaultSecureEndpoint(url, authMethodsSupported);
}
Aggregations