Package io.vertx.ext.web.handler
Interface OtpAuthHandler
-
- All Superinterfaces:
AuthenticationHandler
,Handler<RoutingContext>
public interface OtpAuthHandler extends AuthenticationHandler
An auth handler that provides One Time Password (Multi-Factor) Authentication support.- Author:
- Paulo Lopes
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static OtpAuthHandler
create(HotpAuth hotpAuth)
Create a new instance of this handler using a hash based one time password authentication provider.static OtpAuthHandler
create(TotpAuth totpAuth)
Create a new instance of this handler using a time based one time password authentication provider.OtpAuthHandler
issuer(String issuer)
Configure theissuer
value to be shown in the authenticator URL.OtpAuthHandler
label(String label)
Configure thelabel
value to be shown in the authenticator URL.OtpAuthHandler
setupCallback(Route route)
Setup the required route where authenticators to submit the challenge response.OtpAuthHandler
setupRegisterCallback(Route route)
Setup the optional route where authenticators are allowed to register.OtpAuthHandler
verifyUrl(String url)
Specify the URL where requests are to be redirected when a user is already known in the request.
-
-
-
Method Detail
-
create
static OtpAuthHandler create(TotpAuth totpAuth)
Create a new instance of this handler using a time based one time password authentication provider.- Parameters:
totpAuth
- the time based OTP provider.- Returns:
- new instance of the handler.
-
create
static OtpAuthHandler create(HotpAuth hotpAuth)
Create a new instance of this handler using a hash based one time password authentication provider.- Parameters:
hotpAuth
- the hash based OTP provider.- Returns:
- new instance of the handler.
-
verifyUrl
OtpAuthHandler verifyUrl(String url)
Specify the URL where requests are to be redirected when a user is already known in the request. A user is already known when theUserContext.get()
is notnull
. If no redirect is provided, requests are terminated immediately with status code401
.- Parameters:
url
- the location where users are to be asked for the OTP code.- Returns:
- fluent self.
-
setupRegisterCallback
OtpAuthHandler setupRegisterCallback(Route route)
Setup the optional route where authenticators are allowed to register. Registration is only allowed on requests with a valid user. A user is valid when theUserContext.get()
is notnull
.- Parameters:
route
- the location where users are to register new authenticator devices/apps.- Returns:
- fluent self.
-
setupCallback
OtpAuthHandler setupCallback(Route route)
Setup the required route where authenticators to submit the challenge response. Challenges are only allowed on requests with a valid user. A user is valid when theUserContext.get()
is notnull
.- Parameters:
route
- the location where users are to submit challenge responses from authenticator devices/apps.- Returns:
- fluent self.
-
issuer
OtpAuthHandler issuer(String issuer)
Configure theissuer
value to be shown in the authenticator URL.- Parameters:
issuer
- aString
for exampleVert.x OTP
- Returns:
- fluent self.
-
label
OtpAuthHandler label(String label)
Configure thelabel
value to be shown in the authenticator URL. When this value is provided it will overwrite the default label which is composed of theissuer
and the currentuser
id.- Parameters:
label
- aString
for exampleVert.x OTP
- Returns:
- fluent self.
-
-