46.104 RESET_PASSWORD Procedure

This procedure changes the password of p_user_name in the current workspace to p_new_password. If p_change_password_on_first_use is TRUE, then the user has to change the password on the next login.

Syntax

APEX_UTIL.RESET_PASSWORD (
    p_user_name                     IN VARCHAR2 DEFAULT
                                        www_flow_security.g_user,
    p_old_password                  IN VARCHAR2 DEFAULT NULL,
    p_new_password                  IN VARCHAR2,
    p_change_password_on_first_use  IN BOOLEAN DEFAULT TRUE );

Parameters

Table 46-86 RESET_PASSWORD Parameters

Parameter Description
p_user_name The user whose password should be changed. The default is the currently logged in Oracle APEX user name.
p_old_password The current password of the user. The call succeeds if the given value matches the current password or it is NULL and the owner of the calling PL/SQL code has APEX_ADMINISTRATOR_ROLE. If the value is not the user's password, an error occurs.
p_new_password The new password.
p_change_password_on_first_use If TRUE (default), the user must change the password on the next login.

Error Returns

Table 46-87 RESET_PASSWORD Errors

Error Description
INVALID_CREDENTIALS Occurs if p_user_name does not match p_old_password.
APEX.AUTHENTICATION.LOGIN_THROTTLE.COUNTER Indicates authentication prevented by login throttle.
internal error Occurs if p_old_password is NULL and caller does not have APEX_ADMINISTRATOR_ROLE.
internal error Indicates caller is not a valid workspace schema.

Example

This example demonstrates changes the password of the currently logged-in user to a new password.

apex_util.reset_password (
    p_old_password => :P111_OLD_PASSWORD,
    p_new_password => :P111_NEW_PASSWORD );