Class DefaultAuthorizationRedirectHandler
java.lang.Object
io.micronaut.security.oauth2.endpoint.authorization.request.DefaultAuthorizationRedirectHandler
- All Implemented Interfaces:
AuthorizationRedirectHandler
@Singleton
public class DefaultAuthorizationRedirectHandler
extends Object
implements AuthorizationRedirectHandler
Builds an authorization redirect url.
- Since:
- 1.2.0
- Author:
- Sergio del Amo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
expandedUri
(@NonNull String baseUrl, @NonNull Map<String, Object> queryParams) instantiateParameters
(AuthorizationRequest authorizationRequest, io.micronaut.http.MutableHttpResponse response) protected void
populateAcrValues
(@NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateClientId
(@NonNull AuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateDisplay
(@NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateIdTokenHint
(@NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateLoginHint
(@NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateMaxAge
(@NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateNonce
(@NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters, @NonNull io.micronaut.http.MutableHttpResponse response) protected void
populatePKCE
(@NonNull AuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters, @NonNull io.micronaut.http.MutableHttpResponse<?> response) protected void
populatePrompt
(@NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateRedirectUri
(@NonNull AuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateResponseMode
(@NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateResponseType
(@NonNull AuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateScope
(@NonNull AuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) protected void
populateState
(@NonNull AuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters, @NonNull io.micronaut.http.MutableHttpResponse response) protected void
populateUiLocales
(@NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull Map<String, Object> parameters) io.micronaut.http.MutableHttpResponse
redirect
(AuthorizationRequest authorizationRequest, String authorizationEndpoint) Builds the URL string to redirect to.
-
Constructor Details
-
DefaultAuthorizationRedirectHandler
public DefaultAuthorizationRedirectHandler()
-
-
Method Details
-
redirect
public io.micronaut.http.MutableHttpResponse redirect(AuthorizationRequest authorizationRequest, String authorizationEndpoint) Description copied from interface:AuthorizationRedirectHandler
Builds the URL string to redirect to.- Specified by:
redirect
in interfaceAuthorizationRedirectHandler
- Parameters:
authorizationRequest
- The authorization requestauthorizationEndpoint
- The authorization endpoint- Returns:
- The authorization redirect url
-
expandedUri
protected String expandedUri(@NonNull @NonNull String baseUrl, @NonNull @NonNull Map<String, Object> queryParams) - Parameters:
baseUrl
- Base UrlqueryParams
- Query Parameters- Returns:
- The Expanded URI
-
instantiateParameters
protected Map<String,Object> instantiateParameters(AuthorizationRequest authorizationRequest, io.micronaut.http.MutableHttpResponse response) - Parameters:
authorizationRequest
- Authentication Requestresponse
- Authorization Redirect Response- Returns:
- A parameter map which contains the URL variables used to construct the authorization redirect url.
-
populateScope
protected void populateScope(@NonNull @NonNull AuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populateResponseType
protected void populateResponseType(@NonNull @NonNull AuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populateClientId
protected void populateClientId(@NonNull @NonNull AuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populateRedirectUri
protected void populateRedirectUri(@NonNull @NonNull AuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populateState
protected void populateState(@NonNull @NonNull AuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters, @NonNull @NonNull io.micronaut.http.MutableHttpResponse response) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parametersresponse
- Authorization Redirect Response
-
populatePKCE
protected void populatePKCE(@NonNull @NonNull AuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters, @NonNull @NonNull io.micronaut.http.MutableHttpResponse<?> response) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parametersresponse
- Authorization Redirect Response
-
populateResponseMode
protected void populateResponseMode(@NonNull @NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populateNonce
protected void populateNonce(@NonNull @NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters, @NonNull @NonNull io.micronaut.http.MutableHttpResponse response) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parametersresponse
- Authorization Redirect Response
-
populateDisplay
protected void populateDisplay(@NonNull @NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populatePrompt
protected void populatePrompt(@NonNull @NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populateMaxAge
protected void populateMaxAge(@NonNull @NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populateUiLocales
protected void populateUiLocales(@NonNull @NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populateIdTokenHint
protected void populateIdTokenHint(@NonNull @NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populateLoginHint
protected void populateLoginHint(@NonNull @NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-
populateAcrValues
protected void populateAcrValues(@NonNull @NonNull OpenIdAuthorizationRequest authorizationRequest, @NonNull @NonNull Map<String, Object> parameters) - Parameters:
authorizationRequest
- Authentication Requestparameters
- Authentication Request Parameters
-