public interface TotpAuth extends AuthenticationProvider
Modifier and Type | Method and Description |
---|---|
TotpAuth |
authenticatorFetcher(java.util.function.Function<String,Future<Authenticator>> fetcher)
|
TotpAuth |
authenticatorUpdater(java.util.function.Function<Authenticator,Future<Void>> updater)
Provide a
Function that can update or insert a Authenticator . |
static TotpAuth |
create()
Creates an instance of TotpAuth.
|
static TotpAuth |
create(TotpAuthOptions totpAuthOptions)
Creates an instance of TotpAuth.
|
Future<Authenticator> |
createAuthenticator(String id,
OtpKey otpKey)
Creating authenticator from user id and key.
|
default String |
generateUri(OtpKey otpKey,
String label)
Creating URI for register in key in user device.
|
default String |
generateUri(OtpKey otpKey,
String issuer,
String user)
Creating URI for register in key in user device.
|
String |
generateUri(OtpKey otpKey,
String issuer,
String user,
String label)
Creating URI for register in key in user device.
|
authenticate, authenticate, authenticate, authenticate
TotpAuth authenticatorFetcher(java.util.function.Function<String,Future<Authenticator>> fetcher)
Function
that can fetch Authenticator
s from a backend given an identifier
argument.
The function signature is as follows:
(id) -> Future<Authenticator>
id
the identifier to lookup.Future
async result with a authenticator.fetcher
- fetcher function.TotpAuth authenticatorUpdater(java.util.function.Function<Authenticator,Future<Void>> updater)
Function
that can update or insert a Authenticator
.
The function should store a given authenticator to a persistence storage.
When an authenticator is already present, this method must at least update
Authenticator.getCounter()
, and is not required to perform any other update.
For new authenticators, the whole object data must be persisted.
The function signature is as follows:
(Authenticator) -> Future<Void>
Authenticator
the authenticator data to update.Future
async result of the operation.updater
- updater function.Future<Authenticator> createAuthenticator(String id, OtpKey otpKey)
id
- id user.otpKey
- key of user used for auth.Authenticator
an object containing all the necessary information to authenticate a user.String generateUri(OtpKey otpKey, String issuer, String user, String label)
otpKey
- user key.issuer
- issuer of key.user
- display name of user account.label
- the label to identify which account a key is associated with.default String generateUri(OtpKey otpKey, String issuer, String user)
otpKey
- user key.issuer
- issuer of key.user
- display name of user account.default String generateUri(OtpKey otpKey, String label)
otpKey
- user key.label
- the label to identify which account a key is associated with.static TotpAuth create()
TotpAuth
.static TotpAuth create(TotpAuthOptions totpAuthOptions)
totpAuthOptions
- the config.TotpAuth
.Copyright © 2023 Eclipse. All rights reserved.