RESET_PASSWORD Procedure

This procedure is used to change the password of a given user name for the current workspace. 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 35-84 RESET_PASSWORD Parameters

Parameter Description

p_user_name

The user whose password should be changed. The default is the currently logged in Application Express 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 35-85 RESET_PASSWORD Parameters

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 changing 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 );