DBMS_MFA_ADMIN Package
The DBMS_MFA_ADMIN package facilitates and configures the SQL Token Access.
- Summary of DBMS_MFA_ADMIN Subprograms
Summarizes the subprograms included in theDBMS_MFA_ADMINpackage.
Parent topic: Autonomous AI Database Supplied Package Reference
Summary of DBMS_MFA_ADMIN Subprograms
Summarizes the subprograms included in the DBMS_MFA_ADMIN package.
- REGISTER_USER Procedure
TheDBMS_MFA_ADMIN.REGISTER_USERprocedure registers an existing database user for MFA by associating the user with an email address as the external identity. You can enable MFA for logon authentication, SQL access, or both. It supports email, Slack, and authenticator apps for delivering secure access tokens. - SET_GLOBAL_TOKEN_ATTRIBUTES Procedure
TheDBMS_MFA_ADMIN.SET_GLOBAL_TOKEN_ATTRIBUTESprocedure sets or updates SQL Access Token MFA attributes globally for all registered users. - SET_ATTRIBUTE Procedure
TheDBMS_MFA_ADMIN.SET_ATTRIBUTEsets or updates a single MFA attribute for a registered user and overrides any applicable global default for that attribute. - SET_ATTRIBUTES Procedure
TheDBMS_MFA_ADMIN.SET_ATTRIBUTESprocedure sets or updates one or more MFA attributes for a registered user and overrides any applicable global defaults for those attributes. - CONFIGURE_NOTIFICATION Procedure
TheDBMS_MFA_ADMIN.CONFIGURE_NOTIFICATIONprocedure configures the channels through which MFA tokens are sent to registered users. This includes defining the delivery method and the channel-specific properties required for token distribution. - DEREGISTER_USER Procedure
TheDBMS_MFA_ADMIN.DEREGISTER_USERprocedure removes a database user who is currently registered for MFA. After the user is removed, MFA is no longer enforced for that account, and the user can authenticate without a second factor.
Parent topic: DBMS_MFA_ADMIN Package
REGISTER_USER Procedure
The DBMS_MFA_ADMIN.REGISTER_USER procedure registers an existing database user for MFA by associating the user with an email address as the external identity. You can enable MFA for logon authentication, SQL access, or both. It supports email, Slack, and authenticator apps for delivering secure access tokens.
Syntax
DBMS_MFA_ADMIN.REGISTER_USER (
username IN VARCHAR2,
type IN VARCHAR2,
email IN CLOB DEFAULT NULL,
attributes IN CLOB DEFAULT NULL
);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the username for which the Multifactor Authentication needs to be enforced. |
|
|
Specifies the MFA attribute that controls when MFA is enforced for the user. type accepts the following values:
|
|
|
Specifies the email address to associate with the user for MFA. |
|
|
Specifies MFA attributes in JSON format. Use
|
Examples
Example to register a user for MFA logon:
BEGIN
DBMS_MFA_ADMIN.REGISTER_USER(
user_name => 'SCOTT',
type => 'LOGON',
email => 'scott@example.com',
token_attributes => '{"auth_method":"oma_push"}'
);
END;
/
Example to register a user for SQL access by setting the MFA attributes.
BEGIN
DBMS_MFA_ADMIN.REGISTER_USER(
user_name => 'SCOTT',
type => 'SQL ACCESS',
email => 'scott@example.com',
attributes => '{
"duration_min" : 720,
"read_only" : true,
"roles" : ["DEVELOPER_ROLE", "INFRA_ROLE"],
"scope" : "SESSION",
"slack_member_id": "<slack_user_id>"
}'
);
END;
/
Usage Notes
-
To register a user you must be logged in as the
ADMINuser or have privileges on theDBMS_MFA_ADMINpackage. -
You can register database users for MFA using different providers depending on the MFA type: Duo and OMA are supported for login-time MFA, while Slack, OMA, and email are supported for SQL Access Token MFA.
-
You can register the same user for both MFA types (MFA Logon and SQL Access) by registering them separately for each. You may use the same or different email address for each registration; once configured, the user receives a push notification to the registered email address at logon, and another notification, to the same address, if used, when the user runs
INITIALIZE_SESSIONfor SQL Access.
Parent topic: Summary of DBMS_MFA_ADMIN Subprograms
SET_GLOBAL_TOKEN_ATTRIBUTES Procedure
The DBMS_MFA_ADMIN.SET_GLOBAL_TOKEN_ATTRIBUTES procedure sets or updates SQL Access Token MFA attributes globally for all registered users.
Syntax
DBMS_MFA_ADMIN.SET_GLOBAL_TOKEN_ATTRIBUTES(
attributes IN VARCHAR2
);Parameters
| Parameter | Description |
|---|---|
|
|
Specifies token attributes in JSON format to generate a Access Token. Valid values are:
|
Usage Note
-
To set the token attributes you must be logged in as the
ADMINuser or have privileges on theDBMS_MFA_ADMINpackage.
Parent topic: Summary of DBMS_MFA_ADMIN Subprograms
SET_ATTRIBUTE Procedure
The DBMS_MFA_ADMIN.SET_ATTRIBUTE sets or updates a single MFA attribute for a registered user and overrides any applicable global default for that attribute.
Note:
For log-in time MFA,auth_method is the only supported attribute.
Syntax
DBMS_MFA_ADMIN.SET_ATTRIBUTE(
username IN VARCHAR2,
type IN VARCHAR2,
email IN VARCHAR2 DEFAULT NULL,
attribute_name IN VARCHAR2,
attribute_value IN CLOB
);Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the database user whose MFA attribute is to be updated. |
|
|
Specifies the MFA attribute that controls when MFA is enforced for the user. Valid values are:
|
|
|
Specifies the email address to be associated with the user for MFA. This parameter is optional and defaults to |
|
|
Specifies the name of the MFA attribute to be updated. Valid values are:
|
|
|
New value for the specified attribute. |
Example
SCOTT:BEGIN
DBMS_MFA_ADMIN.SET_ATTRIBUTE(
username => 'scott',
type => 'sql access',
email => 'testscott@example.com',
attribute_name => 'duration_min',
attribute_value => '20');
END;
/Usage Notes
-
The
usernameparameter must specify an existing database user registered for MFA. -
You must be logged in as the
ADMINuser or have privileges on theDBMS_MFA_ADMINpackage to run this procedure.
Parent topic: Summary of DBMS_MFA_ADMIN Subprograms
SET_ATTRIBUTES Procedure
The DBMS_MFA_ADMIN.SET_ATTRIBUTES procedure sets or updates one or more MFA attributes for a registered user and overrides any applicable global defaults for those attributes.
Note:
For log-in time MFA,auth_method is the only supported attribute.
Syntax
DBMS_MFA_ADMIN.SET_ATTRIBUTES (
username IN VARCHAR2,
type IN VARCHAR2,
attributes IN CLOB
);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the username whose MFA attributes are to be updated. |
|
|
Specifies the MFA attribute that controls when MFA is enforced for the user. Valid values are:
|
attributes |
Specifies MFA attributes in JSON format. Valid values are:
|
Example
SCOTT:BEGIN
DBMS_MFA_ADMIN.SET_ATTRIBUTES(
username => 'SCOTT',
type => 'SQL ACCESS',
attributes => json_object(
'duration_min' VALUE 15,
'email' VALUE 'testscott@example.com',
'scope' VALUE 'session',
'idle_timeout_min' VALUE 10)
);
END;
/Usage Notes
-
The
USERNAMEparameter must specify an existing database user registered for MFA. -
You must be logged in as the
ADMINuser or have privileges on theDBMS_MFA_ADMINpackage to run this procedure.
Parent topic: Summary of DBMS_MFA_ADMIN Subprograms
CONFIGURE_NOTIFICATION Procedure
The DBMS_MFA_ADMIN.CONFIGURE_NOTIFICATION procedure configures the channels through which MFA tokens are sent to registered users. This includes defining the delivery method and the channel-specific properties required for token distribution.
Syntax
DBMS_MFA_ADMIN.CONFIGURE_NOTIFICATION (
notification_type IN VARCHAR2,
attributes IN CLOB
);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the type of notification channel to be configured. Valid values are: |
|
|
Provides the configuration details for the specified notification channel in JSON format. Following are the valid attribute types for each of these notification channel: EMAIL: Required for MFA logon setup; OTP via email supported only for SQL Access Token MFA
SLACK: Supported only for SQL Acccess Token MFA
OMA: Supported for both Logon and SQL Acccess Token MFA
DUO: Only supported only for Logon MFA:
|
Examples
Example: Configure EMAIL notification channel
BEGIN
DBMS_MFA_ADMIN.CONFIGURE_NOTIFICATION (
notification_type => 'EMAIL',
attributes => JSON_OBJECT(
'credential_name' VALUE 'EMAIL_CRED',
'smtp_host' VALUE 'smtp.email.us-phoenix-1.oci.oraclecloud.com',
'sender' VALUE 'send.email@test.com',
'smtp_port' VALUE 587,
'sender_email_display_name' VALUE 'DB SECURITY')
);
END;
/
Example: Configure Slack notification channel
BEGIN
DBMS_MFA_ADMIN.CONFIGURE_NOTIFICATION(
notification_type => 'SLACK',
attributes => JSON_OBJECT('credential_name' VALUE 'SLACK_CRED')
);
END;
/Example: Configure OMA notification channel
BEGIN
DBMS_MFA_ADMIN.CONFIGURE_NOTIFICATION(
notification_type => 'OMA',
attributes => JSON_OBJECT(
'credential_name' VALUE 'OMA_CRED_01',
'api_endpoint' VALUE 'https://idcs-xyz.identity.oraclecloud.com'
)
);
END;
/
Example: Configure DUO notification channel
BEGIN
DBMS_MFA_ADMIN.CONFIGURE_NOTIFICATION(
notification_type => 'OMA',
attributes => JSON_OBJECT(
'credential_name' VALUE 'OMA_CRED_01',
'api_endpoint' VALUE 'https://idcs-xyz.identity.oraclecloud.com'
)
);
END;
/Usage Notes
-
To run this procedure you must be logged in as the
ADMINuser or have privileges on theDBMS_MFA_ADMINpackage. -
For Slack notifications, set the required credential and confirm that Slack integration is enabled in your environment. Slack notifications are supported only for SQL access MFA operations.
-
To set the token attributes you must be logged in as the
ADMINuser or have privileges on theDBMS_MFA_ADMINpackage. -
For Authenticator App–based Tokens:
-
Install a supported authenticator app on the mobile device you intend to register for MFA.
-
You must set up MFA using a device that you can access every time you sign in. MFA cannot be enabled on your behalf by another user.
-
To enable MFA, use the authenticator app on your mobile device to scan the QR code generated in the Database Actions UI. See Configuring the Oracle Mobile Authenticator for more information.
You can register only one mobile device for MFA.
-
- For Email-based Token delivery, ensure that email delivery is enabled and that valid email addresses are configured for database users. See Send Email on Autonomous AI Database for more information.
- For Slack-based Token delivery, configure the Slack plugin and register the user’s Slack ID for OTP delivery. See Send Slack Notifications from Autonomous AI Database for more information.
-
Parent topic: Summary of DBMS_MFA_ADMIN Subprograms
DEREGISTER_USER Procedure
The DBMS_MFA_ADMIN.DEREGISTER_USER procedure removes a database user who is currently registered for MFA. After the user is removed, MFA is no longer enforced for that account, and the user can authenticate without a second factor.
Syntax
PROCEDURE DBMS_MFA_ADMIN.DEREGISTER_USER (
username IN VARCHAR2,
type IN VARCHAR2,
email IN VARCHAR2 DEFAULT NULL
);Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the username for which the Multifactor Authentication needs to be removed. |
type |
Specifies the MFA attribute that controls when MFA is enforced for the user. Valid values are:
|
email |
Specifies the email address associated with the user for MFA. This parameter is optional and defaults to |
Examples
BEGIN
DBMS_MFA_ADMIN.DEREGISTER_USER(
username => 'SCOTT',
type => 'SQL ACCESS',
email => 'scott@example.com'
);
END;
/This example deregisters user SCOTT from MFA for the specified type (SQL ACCESS) and removes the associated email identity (scott@example.com) from the MFA configuration.
Usage Note
-
To run this procedure you must be logged in as the
ADMINuser or have privileges on theDBMS_MFA_ADMINpackage. - If a user is registered with multiple email addresses, unregister each email address individually.
Parent topic: Summary of DBMS_MFA_ADMIN Subprograms