Class DefaultOauthRouteUrlBuilder

java.lang.Object
io.micronaut.security.oauth2.url.DefaultOauthRouteUrlBuilder
All Implemented Interfaces:
AbsoluteUrlBuilder<io.micronaut.http.HttpRequest<?>>, OauthRouteUrlBuilder<io.micronaut.http.HttpRequest<?>>

@Requires(beans=io.micronaut.http.server.util.HttpHostResolver.class) @Singleton public class DefaultOauthRouteUrlBuilder extends Object implements OauthRouteUrlBuilder<io.micronaut.http.HttpRequest<?>>
Default implementation of OauthRouteUrlBuilder.
Since:
1.2.0
Author:
James Kleeh
  • Method Summary

    Modifier and Type
    Method
    Description
    protected URL
    build(@Nullable io.micronaut.http.HttpRequest<?> originating, String providerName, String uriTemplate)
    Builds a URL with the provided arguments.
    buildCallbackUri(@Nullable String providerName)
    Builds the URI to receive the OAuth 2.0 authorization callback request.
    buildCallbackUrl(@Nullable io.micronaut.http.HttpRequest<?> originating, String providerName)
    Builds the URL to receive the OAuth 2.0 authorization callback request.
    buildLoginUri(@Nullable String providerName)
    Builds the URI to start the OAuth 2.0 authorization code flow.
    buildLoginUrl(@Nullable io.micronaut.http.HttpRequest<?> originating, String providerName)
    Builds the URL to start the OAuth 2.0 authorization code flow.
    buildUrl(@Nullable io.micronaut.http.HttpRequest<?> current, String path)
    Builds an absolute URL for the given path.
    protected String
    getPath(String uriTemplate, String providerName)
    Builds the path portion of the URL.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • buildLoginUrl

      public URL buildLoginUrl(@Nullable @Nullable io.micronaut.http.HttpRequest<?> originating, String providerName)
      Description copied from interface: OauthRouteUrlBuilder
      Builds the URL to start the OAuth 2.0 authorization code flow.
      Specified by:
      buildLoginUrl in interface OauthRouteUrlBuilder<io.micronaut.http.HttpRequest<?>>
      Parameters:
      originating - The originating request
      providerName - The oauth provider name
      Returns:
      The URL
    • buildCallbackUrl

      public URL buildCallbackUrl(@Nullable @Nullable io.micronaut.http.HttpRequest<?> originating, String providerName)
      Description copied from interface: OauthRouteUrlBuilder
      Builds the URL to receive the OAuth 2.0 authorization callback request.
      Specified by:
      buildCallbackUrl in interface OauthRouteUrlBuilder<io.micronaut.http.HttpRequest<?>>
      Parameters:
      originating - The originating request
      providerName - The oauth provider name
      Returns:
      The URL
    • buildLoginUri

      public URI buildLoginUri(@Nullable @Nullable String providerName)
      Description copied from interface: OauthRouteUrlBuilder
      Builds the URI to start the OAuth 2.0 authorization code flow.
      Specified by:
      buildLoginUri in interface OauthRouteUrlBuilder<io.micronaut.http.HttpRequest<?>>
      Parameters:
      providerName - The oauth provider name
      Returns:
      The URL
    • buildCallbackUri

      public URI buildCallbackUri(@Nullable @Nullable String providerName)
      Description copied from interface: OauthRouteUrlBuilder
      Builds the URI to receive the OAuth 2.0 authorization callback request.
      Specified by:
      buildCallbackUri in interface OauthRouteUrlBuilder<io.micronaut.http.HttpRequest<?>>
      Parameters:
      providerName - The oauth provider name
      Returns:
      The URL
    • build

      protected URL build(@Nullable @Nullable io.micronaut.http.HttpRequest<?> originating, String providerName, String uriTemplate)
      Builds a URL with the provided arguments.
      Parameters:
      originating - The originating request
      providerName - The oauth provider name
      uriTemplate - The URI template
      Returns:
      The URL
    • getPath

      protected String getPath(String uriTemplate, String providerName)
      Builds the path portion of the URL.
      Parameters:
      uriTemplate - The uri template
      providerName - The provider name
      Returns:
      The URL path
    • buildUrl

      public URL buildUrl(@Nullable @Nullable io.micronaut.http.HttpRequest<?> current, String path)
      Description copied from interface: AbsoluteUrlBuilder
      Builds an absolute URL for the given path.
      Specified by:
      buildUrl in interface AbsoluteUrlBuilder<io.micronaut.http.HttpRequest<?>>
      Parameters:
      current - The current request
      path - The path
      Returns:
      The absolute URL