use of io.micronaut.security.oauth2.endpoint.authorization.request.AuthorizationRequest in project micronaut-security by micronaut-projects.
the class DefaultOauthClient method authorizationRedirect.
@Override
public Publisher<MutableHttpResponse<?>> authorizationRedirect(HttpRequest<?> originating) {
AuthorizationRequest authorizationRequest = beanContext.createBean(OauthAuthorizationRequest.class, originating, clientConfiguration);
String authorizationEndpoint = clientConfiguration.getAuthorization().flatMap(EndpointConfiguration::getUrl).orElseThrow(() -> new ConfigurationException("Oauth client requires the authorization URL to be set in configuration"));
if (LOG.isTraceEnabled()) {
LOG.trace("Starting authorization code grant flow to provider [{}]. Redirecting to [{}]", getName(), authorizationEndpoint);
}
return Flux.just(redirectHandler.redirect(authorizationRequest, authorizationEndpoint));
}
use of io.micronaut.security.oauth2.endpoint.authorization.request.AuthorizationRequest in project micronaut-security by micronaut-projects.
the class DefaultOpenIdClient method authorizationRedirect.
@Override
public Publisher<MutableHttpResponse<?>> authorizationRedirect(HttpRequest<?> originating) {
AuthorizationRequest authorizationRequest = beanContext.createBean(OpenIdAuthorizationRequest.class, originating, clientConfiguration);
String endpoint = openIdProviderMetadata.get().getAuthorizationEndpoint();
if (LOG.isTraceEnabled()) {
LOG.trace("Starting authorization code grant flow to provider [{}]. Redirecting to [{}]", getName(), endpoint);
}
return Flux.just(redirectUrlBuilder.redirect(authorizationRequest, endpoint));
}
Aggregations