DBMS_MFA Package

The DBMS_MFA provides subprograms to request and generate SQL Access Tokens, deliver the MFA challenge through the configured channel, and complete token authorization for the current user or session. These subprograms are used specifically with SQL Access Token MFA to initialize and validate SQL access after the user has connected using their primary authentication method.

Summary of DBMS_MFA Subprograms

Summarizes the subprograms included in the DBMS_MFA package.

SET_TOKEN Procedure

The DBMS_MFA.SET_TOKEN procedure to sets SQL Access Token for the registered user..

Syntax

DBMS_MFA.SET_TOKEN(
    token  IN VARCHAR2,
    email  IN  VARCHAR2 DEFAULT NULL
);

Parameters

Parameter Description

token

Specifies the user access token to validate the session.

email

Specifies the email used to initialize the token.

Example

BEGIN
    DBMS_MFA.SET_TOKEN (
        token => 'token');                                                                 
END;                                                                 
/

Usage Notes

  • You must have privileges on the DBMS_MFA package to run this procedure.

  • An error is returned if the provided token code is invalid.

  • When using push notification, you do not need to set the token manually with DBMS_MFA.SET_TOKEN.

INITIALIZE_SESSION Procedure

The DBMS_MFA.INITIALIZE_SESSION procedure initializes the database session using the specified email.

The DBMS_MFA.INITIALIZE_SESSION procedure accepts a user's email address as an argument. If the provided email id is associated with a registered user to use SQL Token Access, a token code is sent to the user. This token code is then used to validate the user using the DBMS_MFA.SET_TOKEN procedure. See SET_TOKEN Procedure for more information.

Syntax

DBMS_MFA.INITIALIZE_SESSION (       
      email  IN  VARCHAR2
);

Parameters

Parameter Description

email

Specifies the email address registered for the user.

Example

BEGIN
    DBMS_MFA.INITIALIZE_SESSION (
        email => 'email'
 );                                                                 
END;                                                                 
/

Usage Notes

  • You must have privileges on the DBMS_MFA package to run this procedure.
  • An error is returned if the provided email id is not valid or registered.
  • When an authenticator app is used, an OTP is not sent to the user; instead, a push notification is sent to the authenticator app for approval.
  • When using push notification, you do not need to manually set or enter a Token using DBMS_MFA.SET_TOKEN.