Interface Registration
- All Superinterfaces:
HttpOperation<Registration>
,Operation
Usage example:
private void register(Operations operations, String username, AuthorizationProvider authorizationProvider, DeviceInformation deviceInformation) { operations.registration() .username(username) .authorizationProvider(authorizationProvider) .deviceInformation(deviceInformation) .authenticatorSelector((ctx, consumer) -> { // select authenticator }) .pinEnroller((ctx, consumer) -> { // handle PIN enrollment }) .pinUserVerifier(pinUserVerifier) .onError(error -> { // handle error }) .onSuccess(result -> { // handle success }) .execute(); }
The fingerprint, biometric and device passcode authenticators are enrolled at the OS level.
That is why, if one of them must be registered, the user must authenticate through
either the provided FingerprintUserVerifier
, BiometricUserVerifier
or
DevicePasscodeUserVerifier
.
In the case of the PIN and password, the credentials is enrolled during registration, so no
authentication is needed.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionallowClass2Sensors
(boolean allowClass2Sensors) Specifies whether Class 2 (formerly weak) biometric sensors are allowed if the biometric authenticator is selected.allowDevicePasscodeAsFallback
(boolean allowDevicePasscodeAsFallback) Specifies whether the OS device passcode (PIN, password, gesture) can be used as fallback during biometric authentication.authenticatorSelector
(AuthenticatorSelector selector) Specifies the object that will take care of the selection of the authenticator to be used.authorizationProvider
(AuthorizationProvider authorizationProvider) Specifies the authorization provider that must be used to register.biometricUserVerifier
(BiometricUserVerifier userVerifier) Specifies the object that will take care of the biometric user verification.deviceInformation
(DeviceInformation deviceInformation) Specifies the device information to be used.devicePasscodeUserVerifier
(DevicePasscodeUserVerifier userVerifier) Specifies the object that will take care of the device passcode user verification.fingerprintUserVerifier
(FingerprintUserVerifier userVerifier) Specifies the object that will take care of the fingerprint user verification.invalidateOnNewOsBiometrics
(boolean invalidateOnNewOsBiometrics) Specifies whether the authenticator must be invalidated if the user adds new biometric credentials in the OS settings.onError
(Consumer<OperationError> errorConsumer) Specifies the object that will be invoked if the registration failed.Specifies the object that will be invoked if the registration completed successfully.passwordEnroller
(PasswordEnroller passwordEnroller) Specifies the object that will take care of enrolling the password of the authenticator.pinEnroller
(PinEnroller pinEnroller) Specifies the object that will take care of enrolling the PIN of the authenticator.Specifies the base URL of the server where the registration should be made.Specifies the username that must be used to register.Methods inherited from interface ch.nevis.mobile.sdk.api.operation.HttpOperation
requestHeaders
-
Method Details
-
username
Specifies the username that must be used to register.Providing the username is required.
- Parameters:
username
- the username- Returns:
- a
Registration
-
serverUrl
Specifies the base URL of the server where the registration should be made. If no server base URL is provided, then the base URL defined inConfiguration.baseUrl()
will be used.It is assumed that all the servers have the same endpoints, thus only the scheme, hostname and port of the URL of the provided
URI
will be taken into account.Examples:
Base URL Resolution in Registration Configuration base URL Provided server URL in Registration Resulting Server URL https://server/path https://other.server https://other.server/path https://server:443/path https://other.server/path https://other.server/path https://server/path http://other.server:80/otherpath http://other.server:80/path - Parameters:
serverUrl
- the URL of the server where the registration should be made.- Returns:
- a
Registration
-
authorizationProvider
Specifies the authorization provider that must be used to register. If noAuthorizationProvider
is given, then anAuthorizationProvider.EmptyAuthorizationProvider
will be used.- Parameters:
authorizationProvider
- theAuthorizationProvider
- Returns:
- a
Registration
-
deviceInformation
Specifies the device information to be used. TheDeviceInformation
is required only if there is not aDeviceInformation
already defined (that is, if this is the first registration). If aDeviceInformation
was already provided in an existing registration, the provided value will be ignored.- Parameters:
deviceInformation
- the device information- Returns:
- a
Registration
-
allowClass2Sensors
Specifies whether Class 2 (formerly weak) biometric sensors are allowed if the biometric authenticator is selected. By default, the SDK will only allow to use Class 3 (formerly strong) sensors. Using Class 2 sensors is less secure and discouraged. When a Class 2 sensor is used, the FIDO UAF keys are not protected by the operating system by requiring user authentication, nor they can be invalidated when biometrics change (seeinvalidateOnNewOsBiometrics(boolean)
).If the SDK detects that only Class 3 (strong) biometric sensors are available in the mobile device, even if Class 2 sensors are allowed, the FIDO UAF credentials will be protected by the operating system by requiring user authentication.
However, in some cases it may be acceptable for the sake of end-user convenience. Allowing Class 2 sensors will enable for instance the use of face recognition in some Samsung devices.
- Parameters:
allowClass2Sensors
- whether using Class 2 biometric sensors is allowed if the biometric authenticator is selected- Returns:
- a
Registration
- See Also:
-
allowDevicePasscodeAsFallback
Specifies whether the OS device passcode (PIN, password, gesture) can be used as fallback during biometric authentication. If not specified, the device passcode cannot be used as fallback.This setting will be ignored on devices running Android API 29 or lower.
This setting and
invalidateOnNewOsBiometrics(boolean)
cannot be enabled together.- Parameters:
allowDevicePasscodeAsFallback
- whether the device passcode can be used as fallback when using the biometric authenticator, or not- Returns:
- a
Registration
-
invalidateOnNewOsBiometrics
Specifies whether the authenticator must be invalidated if the user adds new biometric credentials in the OS settings. If the authenticator has been invalidated, and you try to authenticate with it, an error with codeFidoErrorCode.KEY_DISAPPEARED_PERMANENTLY
will be returned by the authentication operation.This setting only applies to biometric (
Authenticator.BIOMETRIC_AUTHENTICATOR_AAID
) and fingerprint (Authenticator.FINGERPRINT_AUTHENTICATOR_AAID
) authenticators.By setting this parameter to
true
, you increase the security but there is a loss of convenience: adding a new OS biometric credential does not imply necessarily that there is a security risk, but if the end-user does it, a new registration will be required, because an invalidated authenticator cannot be recovered.If not specified, the authenticator will be invalidated when the user adds a new biometric credential in the OS settings.
Note that if the device supports Class 2 sensors, and if class 2 sensors are allowed (see
allowClass2Sensors(boolean)
), the value set in this method will be ignored and the authenticator will not be invalidated if the user adds new biometric credentials in the OS settings.There are some known issues associate with this feature when using some Google Pixel devices. See here
for details.This setting will be ignored on devices running Android API 23.
This setting and
allowDevicePasscodeAsFallback(boolean)
cannot be enabled together.- Parameters:
invalidateOnNewOsBiometrics
- whether an addition of biometric credentials in the OS should invalidate this authenticator (if the authenticator is biometric or fingerprint)- Returns:
- a
Registration
-
authenticatorSelector
Specifies the object that will take care of the selection of the authenticator to be used.Providing the authenticator selector is required.
- Parameters:
selector
- theAuthenticatorSelector
- Returns:
- a
Registration
-
pinEnroller
Specifies the object that will take care of enrolling the PIN of the authenticator. It must be provided only if a PIN authenticator must be registered.Providing at least one of the
BiometricUserVerifier
,PinEnroller
,DevicePasscodeUserVerifier
,PasswordEnroller
orFingerprintUserVerifier
is required.- Parameters:
pinEnroller
- thePinEnroller
- Returns:
- a
Registration
-
passwordEnroller
Specifies the object that will take care of enrolling the password of the authenticator. It must be provided only if a password authenticator must be registered.Providing at least one of the
BiometricUserVerifier
,PinEnroller
,DevicePasscodeUserVerifier
,PasswordEnroller
orFingerprintUserVerifier
is required.- Parameters:
passwordEnroller
- thePasswordEnroller
- Returns:
- a
Registration
-
fingerprintUserVerifier
Specifies the object that will take care of the fingerprint user verification. It must be provided only if a fingerprint authenticator must be registered.Providing at least one of the
BiometricUserVerifier
,PinEnroller
,DevicePasscodeUserVerifier
,PasswordEnroller
orFingerprintUserVerifier
is required.- Parameters:
userVerifier
- theFingerprintUserVerifier
- Returns:
- a
Registration
-
biometricUserVerifier
Specifies the object that will take care of the biometric user verification. It must be provided only if a biometric authenticator must be registered.Providing at least one of the
BiometricUserVerifier
,PinEnroller
,DevicePasscodeUserVerifier
,PasswordEnroller
orFingerprintUserVerifier
is required.- Parameters:
userVerifier
- theBiometricUserVerifier
- Returns:
- a
Registration
-
devicePasscodeUserVerifier
Specifies the object that will take care of the device passcode user verification. It must be provided only if a device passcode authenticator must be registered.Providing at least one of the
BiometricUserVerifier
,PinEnroller
,DevicePasscodeUserVerifier
,PasswordEnroller
orFingerprintUserVerifier
is required.- Parameters:
userVerifier
- theDevicePasscodeUserVerifier
- Returns:
- a
Registration
-
onSuccess
Specifies the object that will be invoked if the registration completed successfully. This object will be invoked in the main/UI thread.Providing the object handling the success is required.
- Parameters:
onSuccess
- the object invoked on successful registration.- Returns:
- a
Registration
-
onError
Specifies the object that will be invoked if the registration failed. The specified object will receive anOperationError
. This object will be invoked in the main/UI thread.Providing the object handling the error is required.
- Parameters:
errorConsumer
- the consumer of anOperationError
- Returns:
- a
Registration
-