Class AbstractEndSessionRequest

java.lang.Object
io.micronaut.security.oauth2.endpoint.endsession.request.AbstractEndSessionRequest
All Implemented Interfaces:
EndSessionEndpoint
Direct Known Subclasses:
Auth0EndSessionEndpoint, AwsCognitoEndSessionEndpoint, KeycloakEndSessionEndpoint, OktaEndSessionEndpoint

public abstract class AbstractEndSessionRequest extends Object implements EndSessionEndpoint
A base class to extend from to log out of an OpenID provider.
Since:
1.2.0
Author:
James Kleeh
  • Field Details

  • Constructor Details

  • Method Details

    • getUrl

      public @Nullable String getUrl(io.micronaut.http.HttpRequest<?> originating, Authentication authentication)
      Builds the end session redirect URL by appending the getArguments(HttpRequest, Authentication) to the query component of getUrl(). The end session URL is treated as an opaque URI, never as a URI template, so a provider cannot influence how the parameters are rendered. Argument values are percent-encoded. A null argument value is skipped and an Iterable or array value is rendered as a repeated parameter. The end session URL must be an absolute http or https URL with a host; a relative URL, another scheme or an authority component carrying user information (https://user:password@host/...) is rejected, since an end session endpoint never legitimately takes those forms.
      Specified by:
      getUrl in interface EndSessionEndpoint
      Parameters:
      originating - The originating request
      authentication - The authentication
      Returns:
      The end session URL, or null if getUrl() is empty, is not an absolute http(s) URL with a host and without user information, or is not a valid URI
    • getUrl

      protected abstract String getUrl()
      Returns:
      The url of the request
    • getArguments

      protected abstract Map<String,Object> getArguments(io.micronaut.http.HttpRequest<?> originating, Authentication authentication)
      Parameters:
      originating - The originating request
      authentication - The authentication
      Returns:
      The parameters to include in the URL
    • getRedirectUri

      protected String getRedirectUri(io.micronaut.http.HttpRequest<?> originating)
      Parameters:
      originating - The originating request
      Returns:
      The absolute redirect URI