Package io.micronaut.security.oauth2.url
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 TypeMethodDescriptionprotected 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.Builds an absolute URL for the given path.protected String
Builds the path portion of the URL.
-
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 interfaceOauthRouteUrlBuilder<io.micronaut.http.HttpRequest<?>>
- Parameters:
originating
- The originating requestproviderName
- 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 interfaceOauthRouteUrlBuilder<io.micronaut.http.HttpRequest<?>>
- Parameters:
originating
- The originating requestproviderName
- The oauth provider name- Returns:
- The URL
-
buildLoginUri
Description copied from interface:OauthRouteUrlBuilder
Builds the URI to start the OAuth 2.0 authorization code flow.- Specified by:
buildLoginUri
in interfaceOauthRouteUrlBuilder<io.micronaut.http.HttpRequest<?>>
- Parameters:
providerName
- The oauth provider name- Returns:
- The URL
-
buildCallbackUri
Description copied from interface:OauthRouteUrlBuilder
Builds the URI to receive the OAuth 2.0 authorization callback request.- Specified by:
buildCallbackUri
in interfaceOauthRouteUrlBuilder<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 requestproviderName
- The oauth provider nameuriTemplate
- The URI template- Returns:
- The URL
-
getPath
Builds the path portion of the URL.- Parameters:
uriTemplate
- The uri templateproviderName
- The provider name- Returns:
- The URL path
-
buildUrl
Description copied from interface:AbsoluteUrlBuilder
Builds an absolute URL for the given path.- Specified by:
buildUrl
in interfaceAbsoluteUrlBuilder<io.micronaut.http.HttpRequest<?>>
- Parameters:
current
- The current requestpath
- The path- Returns:
- The absolute URL
-