Package io.vertx.mutiny.ext.web.handler
Class OAuth2AuthHandler
java.lang.Object
io.vertx.mutiny.ext.web.handler.OAuth2AuthHandler
- All Implemented Interfaces:
MutinyDelegate,io.vertx.core.Handler<RoutingContext>,AuthenticationHandler,Consumer<RoutingContext>
public class OAuth2AuthHandler
extends Object
implements AuthenticationHandler, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>, MutinyDelegate
An auth handler that provides OAuth2 Authentication support. This handler is suitable for AuthCode flows.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Paulo Lopes
- See Also:
-
OAuth2AuthHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.ext.web.handler.AuthenticationHandler
AuthenticationHandler.AuthenticationHandlerImpl -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOAuth2AuthHandler(io.vertx.ext.web.handler.OAuth2AuthHandler delegate) Create a new instance ofOAuth2AuthHandlerdelegating to the given (non-null) instance ofOAuth2AuthHandler.OAuth2AuthHandler(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(RoutingContext item) Handle an item.static OAuth2AuthHandlercreate(Vertx vertx, OAuth2Auth authProvider) Create a OAuth2 auth handler without host pinning.Most providers will not look to the redirect url but always redirect to the preconfigured callback.static OAuth2AuthHandlercreate(Vertx vertx, OAuth2Auth authProvider, String callbackURL) Create a OAuth2 auth handler with host pinning.booleanextraParams(io.vertx.core.json.JsonObject extraParams) Extra parameters needed to be passed while requesting a token.io.vertx.ext.web.handler.OAuth2AuthHandlerGet the delegate instance.voidhandle(RoutingContext item) Handle an item.inthashCode()static OAuth2AuthHandlernewInstance(io.vertx.ext.web.handler.OAuth2AuthHandler delegate) Creates a new instance of theOAuth2AuthHandler.pkceVerifierLength(int length) PKCE (RFC 7636) is an extension to the Authorization Code flow to prevent several attacks and to be able to securely perform the OAuth exchange from public clients.Indicates the type of user interaction that is required.setupCallback(Route route) add the callback handler to a given route.toString()Return a new instance with the internal state copied from the caller but the scopes to be requested during a token request are unique to the instance.withScopes(List<String> scopes) Return a new instance with the internal state copied from the caller but the scopes to be requested during a token request are unique to the instance.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
OAuth2AuthHandler
public OAuth2AuthHandler(io.vertx.ext.web.handler.OAuth2AuthHandler delegate) Create a new instance ofOAuth2AuthHandlerdelegating to the given (non-null) instance ofOAuth2AuthHandler. -
OAuth2AuthHandler
-
-
Method Details
-
accept
Handle an item. This method is generated from theoriginalmethod."- Specified by:
acceptin interfaceAuthenticationHandler- Specified by:
acceptin interfaceConsumer<RoutingContext>
-
handle
Handle an item. This method is generated from theoriginalmethod."- Specified by:
handlein interfaceAuthenticationHandler- Specified by:
handlein interfaceio.vertx.core.Handler<RoutingContext>
-
getDelegate
public io.vertx.ext.web.handler.OAuth2AuthHandler getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceAuthenticationHandler- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
create
Create a OAuth2 auth handler with host pinning. When no scopes are explicit declared, the default scopes will be looked up from the route metadata under the keyscopeswhich can either be a singleStringor aList<String>.- Parameters:
vertx- the vertx instanceauthProvider- the auth provider to usecallbackURL- the callback URL you entered in your provider admin console, usually it should be something like:https://myserver:8888/callback- Returns:
- the auth handler
-
create
Create a OAuth2 auth handler without host pinning.Most providers will not look to the redirect url but always redirect to the preconfigured callback. So this factory does not provide a callback url. When no scopes are explicit declared, the default scopes will be looked up from the route metadata under the keyscopeswhich can either be a singleStringor aList<String>.- Parameters:
vertx- the vertx instanceauthProvider- the auth provider to use- Returns:
- the auth handler
-
extraParams
Extra parameters needed to be passed while requesting a token.- Parameters:
extraParams- extra optional parameters.- Returns:
- self
-
withScope
Return a new instance with the internal state copied from the caller but the scopes to be requested during a token request are unique to the instance. When scopes are applied to the handler, the default scopes from the route metadata will be ignored.- Parameters:
scope- scope.- Returns:
- new instance of this interface.
-
withScopes
Return a new instance with the internal state copied from the caller but the scopes to be requested during a token request are unique to the instance. When scopes are applied to the handler, the default scopes from the route metadata will be ignored.- Parameters:
scopes- scopes.- Returns:
- new instance of this interface.
-
prompt
Indicates the type of user interaction that is required. Not all providers support this or the full list. Well known values are:- login will force the user to enter their credentials on that request, negating single-sign on.
- none is the opposite - it will ensure that the user isn't presented with any interactive prompt whatsoever. If the request can't be completed silently via single-sign on, the Microsoft identity platform endpoint will return an interaction_required error.
- consent will trigger the OAuth consent dialog after the user signs in, asking the user to grant permissions to the app.
- select_account will interrupt single sign-on providing account selection experience listing all the accounts either in session or any remembered account or an option to choose to use a different account altogether.
- Parameters:
prompt- the prompt choice.- Returns:
- self
-
pkceVerifierLength
PKCE (RFC 7636) is an extension to the Authorization Code flow to prevent several attacks and to be able to securely perform the OAuth exchange from public clients. It was originally designed to protect mobile apps, but its ability to prevent authorization code injection makes it useful for every OAuth client, even web apps that use a client secret.- Parameters:
length- A number between 43 and 128. Or -1 to disable.- Returns:
- self
-
setupCallback
add the callback handler to a given route.- Parameters:
route- a given route e.g.:/callback- Returns:
- self
-
newInstance
Creates a new instance of theOAuth2AuthHandler. -
hashCode
public int hashCode() -
equals
-
toString
-