Skip to main content
Version: Next

Authention Module :

If no biometry , if there is an inactivity for n minutes , we should remove the creds .

canActivate function to check if the plugin can be loaded or not

##Authentication Types

User Authentication:

Username and Password ( from OGS IDP / Sectoral IDP ) Biometric Authentication (e.g., Fingerprint, Face ID)

Device Authentication:

Device-based Authentication (e.g., Unique Device Identifier) Certificate-based Authentication (using digital certificates to verify device identity) -not in the current scope - Coming Soon

API Authentication:

OAuth 2.0 (Access Token) JSON Web Tokens (JWT) API Keys (for basic access control)

Authenticating for updates and notifications Push Notification Authentication:

Location-based Authentication:

Using device location as an additional authentication factor

This module will be calling loginPlugin.validateUser() function to validate the user and prompt for login / refresh the token etc.. based on the login mechanism of the AOK selected.

Authenticaton Plugin

The authentication module is a secure and flexible module designed for a mobile application. It provides various authentication mechanisms, including username/password and biometric authentication. The module manages user sessions, validates login responses, and stores user data securely in a vault. Its seamless integration allows for dynamic login mechanisms and enhanced security features, ensuring a smooth and secure user authentication experience.

this plugin will call validateUser() of LoginPlugin configured to initiate user login using OGS / Sectoral IDP

Prototype

Function and Attribute Description for Auth Module

Method or AttributeType / Return TypeNameDescription
AttributeStringidentifierEach plugin has a unique identifier that is used for logging, debugging, and being referenced from other plugins. This identifier should follow this format: <provider>.<app_name>.<plugin_name>. Example: ey.navida.videoconsultation.
MethodvoidonUserInteraction()Internal function to handle user interactions, such as tapping a button.
MethodvoidstartTimeoutTimer()Internal function to start a timeout timer for session management.
MethodvoidclearTimeoutTimer()Internal function to clear the timeout timer.
MethodvoidhandleTimeout()Internal function to handle session timeout.
MethodvoidsetSessionExpirationTime()Internal function to set the session expiration time.
MethodvoidstoreSessionExpirationTime(expirationTime: number)Internal function to store the session expiration time in a secure vault.
MethodbooleanvalidateLoginResponse(loginResponse: any)Internal function to validate the login response received from the selected login mechanism.
MethodUsercreateUserFromLoginResponse(response: any)Internal function to create a user object from the login response.
MethodvoidstoreUserSession(user: User)Internal function to store the user session.
MethodUser or nullgetUserFromSession()Function to retrieve the user from the stored session, returns the user object if a session exists, or null if no session is available.
MethodbooleanisBiometricAvailable()Function to check if biometric authentication is available on the device.
MethodPromise<boolean>authenticateWithBiometric()Function to perform biometric authentication. Returns a promise with a boolean indicating the success of authentication.
MethodvoidstoreInSecureVault(key: string, data: any)Function to store data securely in the native security vault.
MethodanygetFromSecureVault(key: string)Function to retrieve data from the native security vault based on the given key.
MethodvoidremoveFromSecureVault(key: string)Function to remove data from the native security vault based on the given key.
MethodvoidlockSecureVaultWithBiometric()Function to lock the secure vault using biometric authentication.
MethodbooleanisSecureVaultLocked()Function to check if the secure vault is locked.
MethodbooleanverifyAge(age: number)Function to verify the user's age.

Function and Attribute Description for USER classs:

Method or AttributeType / Return TypeNameDescription
AttributeStringusernameThe username of the user.
AttributeStringemailThe email of the user.
MethodStringgetUsername()Function to get the username of the user.
MethodStringgetEmail()Function to get the email of the user.

Session State management

Authenticatin Flow