MobileAuthenticatorScriptService
Name | MobileAuthenticatorScriptService |
Class Path |
|
Versions | 10 |
Overview
The MobileAuthenticatorScriptService
provides an interface for handling mobile authentication using QR codes and mobile authenticators. This service facilitates the generation of authentication QR codes, user enrollment, authentication challenges, and session status retrieval.
Available Functions
getQR(): String
Generates a QR code for mobile authentication.
Returns:
String
: A Base64-encoded image of the QR code for login.null
if no authentication server is available.
register(): String
Registers a user for mobile authentication.
Returns:
String
: A Base64-encoded image of the QR code for enrollment.null
if registration is not possible.
provoke(): boolean
Sends an authentication challenge to the current user.
Returns:
boolean
:true
if the challenge was successfully sent,false
otherwise.
provoke(String userid): boolean
Sends an authentication challenge to a specified user.
Parameters:
userid
(String
): The user ID to challenge.
Returns:
boolean
:true
if the challenge was successfully sent,false
otherwise.
getStatus(): LoginStatus
Retrieves the authentication status of the current user.
Returns:
LoginStatus
: The current login status.null
if no authentication session exists.
getServer(): Server
Retrieves information about the authentication server.
Returns:
Server
: The server information.null
if no server is available.
getVash(): String
Retrieves the visual authentication hash (VASH) for the server.
Returns:
String
: A Base64-encoded image of the VASH.null
if no server is available.
Supporting Functions
maybeServerApi(): Optional<ServerApi>
Checks if a mobile authentication server is available.
Returns:
Optional<ServerApi>
: The authentication server API if available.
currentNonce(): String
Retrieves the current session nonce.
Returns:
String
: The nonce used for authentication.
getNonce(Session session): String
Generates a nonce for the given session.
Parameters:
session
(Session
): The user session.
Returns:
String
: The generated nonce.
currentSession(): Session
Retrieves the current active session.
Returns:
Session
: The active session.Throws an exception if no active session exists.
getMobileAuthenticatorIdp(): Optional<MobileAuthenticatorIdp>
Retrieves the configured mobile authenticator identity provider.
Returns:
Optional<MobileAuthenticatorIdp>
: The mobile authenticator IdP if available.
Summary
The MobileAuthenticatorScriptService
facilitates mobile authentication through QR codes, challenges, and session validation. It allows for:
Generating authentication QR codes.
Registering users for mobile authentication.
Sending authentication challenges.
Retrieving authentication statuses.
Accessing authentication server details.
This service is essential for implementing secure mobile authentication workflows.