Changing password using forms_ddl not working

All,
I am building a custom logon screen that is similar to Metalink Document 30860.1. The form works fine until it encounters error "ORA-28001 password expired". When this occurs the user is moved to a different block (CHNG_PSSWRD) to change their password.
In the OK button on this block I use the forms_ddl command to alter the user's password, then logout and log back in using the new password. This is where the application fails. The forms_ddl built-in returns form_faliure=false however, the password does not change and when the code attempts to logon the user back on the form encounters error ORA:1017. I can verify this by logging into SQL*PLUS, the password is still expired.
Here is the relevant code:
When-Button-Pressed (Item Level, on LOGON_BLOCK.BUTTON_CONNECT)
DECLARE
     v_connectResults varchar2(20);
BEGIN
     v_connectResults := connect_to;
IF v_connectResults = 'YES' THEN
leave(TRUE);
END IF;
:global.logon_tries := TO_NUMBER(:global.logon_tries) - 1;
IF TO_NUMBER(:global.logon_tries) = '0' THEN
leave(FALSE);
END IF;
IF v_connectResults = 'EXPIRED_PASSWORD' THEN
     msg_popup(dbms_error_text,'E',FALSE);
go_block('CHNG_PSSWRD');
END IF;
END;
FUNCTION connect_to RETURN VARCHAR2 IS
BEGIN
IF :logon_block.username IS NULL THEN
BELL;
END IF;
LOGON(:logon_block.username,
:logon_block.password||'@'||:logon_block.connect, FALSE);
IF FORM_SUCCESS THEN
RETURN 'YES';
ELSIF dbms_error_code = -28001 then
     RETURN 'EXPIRED_PASSWORD';
ELSE
     msg_popup(dbms_error_text,'E',FALSE);
RETURN 'NO';
END IF;
END;
PROCEDURE leave(p_status BOOLEAN DEFAULT TRUE) IS
BEGIN
IF p_status THEN
:global.logged_on := 'TRUE';
ELSE
:global.logged_on := 'FALSE';
END IF;
EXIT_FORM;
END;
This procedure is called by the OK button on CHNG_PSSWRD block
PROCEDURE change_password (p_passWrd in varchar2)
IS
v_un varchar2(60) := get_application_property(username);
v_cs varchar2(60):= get_application_property(connect_string);
statement varchar2(100);
begin
-- build the alter user statement for changing the password
statement := 'alter user ' ||v_un ||' identified by ' || p_passWrd;
-- print the contents of statement & connect string for testing purposes
msg_popup(statement || ' connect string: ' || v_cs,'I',FALSE);
     -- execute the alter user statement
forms_ddl(statement);
-- if RDBMS does not accept password, display database error message
if FORM_FAILURE then
     msg_popup(DBMS_ERROR_TEXT,'E',TRUE);
else
     -- password was accepted, log user back in with new password
     logout;
     if FORM_FAILURE then
          msg_popup(DBMS_ERROR_TEXT,'F',TRUE);
     end if;
     logon(v_un,p_passWrd ||'@'||v_cs,FALSE);
     -- Display error message if login fails
     if FORM_FAILURE then
          msg_popup(DBMS_ERROR_TEXT,'F',TRUE);
     else
     msg_popup('Your Password has been changed.','I',True);
     end if;
end if;
end;
This code executes on the form that runs the custom logon form
On-Logon (Form Level)
CALL_FORM('co_f_logon', NO_HIDE);
IF :global.logged_on != 'TRUE' THEN
RAISE FORM_TRIGGER_FAILURE;
END IF;
What am I doing wrong?
thanks for you help in advance
Jim C

This approach may not be the safest, as having a special account able to change other users passwords can bring important security considerations.
For example, suppose the user and password of that special account are "hard coded" in your application. That means you will not be able to change that password often. So, it will bee too easy to use a brute-force attac, to guess this password. After that, you could simply change the password of any user you want, and impersonate it. Of course, there are many other considerations to think of, but I'm sure you get the idea by now.
A much better approach could be to write a little program that receives username, old password, new password and connection as parameters, and uses the Oracle OCI API to change the password. Then you could simply call this little program from your application when needed, providing the right parameters, to do the trick.
I found a good sample of this in metalink note 52718.1, Handling Expired Passwords from within Forms (V4.5/5.0)
In this note, you'll find a little pro-c code to do just that. There is also another note (124970.1) with a little more complicated sample made in Java.
(you may need to select All Sources on metalink to find it, as they have been archived and are no longer presented if you search only the knowledge base).
hope this helps.
Eng. Gabriel Rosales Aymerich, M.Sc.
Senior DBA
Mercado de Valores de Costa Rica

Similar Messages

  • Change Password with spaces not working

    Hi,
    I have configured password policy in OIM as Minimum length as 8
    Min Numeric characters 6
    Min Uppercase Characters 1
    Special Character Minimum 1
    Disallow last passwords 12
    Now at the time of changing password it is accepting spaces in password and when we trying to log in with that password [password having spaces] it is not accepting and we are not able to log in with taht user
    Please reply soon.
    Thanks

    Any updates??

  • Change password on the first use - does not work

    Change password on the first use - does not work.
    Created a user and specified 'Change password on the first use' - when user logs in - the 'Change password' window does not pop- up.
    Please advise.

    (APEX 4.0.2) I am running into this same issue - if you don't set the password expiration and locking to 'Yes', the user gets into the app without being asked to change the pw.
    When you do set expiration and locking - after the user logs on with their temporary password, it does take them to the change password page (4155:50) but the username is blank. Because the username didn't get to the page the old password will never match and you get the "Invalid password" message.
    What am I missing? Anyone successful doing this?
    Simple application, default authentication, no javascript, HTTP_SERVER, no ssl.
    Thanks,
    Steve

  • I got locked out and changed the password. it did not work and now its disabled for 60 minutes. I dont use itunes, or icloud. how can I get in and why wont it work.

    I am locked out of my iphone. I changed the password and it still wont work. I changed it again and it is now disabled. I do not use itunes, icloud. How can I get into my iphone? I have changed my password and its not working. how can I start over?

    Follow the instructions in this support document. http://support.apple.com/kb/ht1212
    Without a backup, the use of iTunes or the use of iCloud, your only choice is to restore the device as new to remove the passcode.

  • How to save bloger password in firefox 3.6.6 ? common ways at internet such as changing nsLoginManager.js is not working because the notepad cant save the new file.

    how to save bloger password in firefox 3.6.6 ?
    common ways at internet such as changing nsLoginManager.js is not working because the notepad cant save the new file.
    == URL of affected sites ==
    http://blogger.com

    Some sites like PayPal, Yahoo, Windows Live and bank sites use ''autocomplete="off"'' to prevent Firefox from saving the name and the password.
    If a site uses ''autocomplete="off"'' then look at this article for a bookmarklet to remove that autocomplete attribute.
    http://kb.mozillazine.org/User_name_and_password_not_remembered (bookmarklet)
    http://kb.mozillazine.org/Password_Manager
    See also http://en.wikipedia.org/wiki/Bookmarklet

  • I am going crazy changing passwords that do not get recognized by the different services when it is time to use them, until I am asked to change the password again, until the next time I need to use it and it does not get recognized again. Is there any fi

    I am going crazy changing passwords that do not get recognized by the different services when it is time to use them, until I am asked to change the password again, starting the vicious cycle again: i need to use the password, it does not get recognized three times, then the system asks me to change it again, and again, and I am stuck!! Is there any fix for this "glitch?

    The first thing I would suggest is for you to go to the folder containing your catalog, using your system browser. There will be a folder that has the extension .lrdata. Delete that folder, and then try to start Lightroom. If that doesn't work, replace your catalog with your most recent backup.

  • HT5463 I changed  password but can not use new password on phone. Why?

    I changed  password but can not use new password on phone. Why?

    Start with the Settings app
    Settings > iTunes and App Store > tap on your Apple ID and then tap on Sign Out
    Then sign in with your correct Apple ID and password.

  • I cant open my ipad after i turned on the voice in accessibility i have a passcode and i tried to enter my password but it not working. help me please

    i cant open my ipad after i turned on the voice in accessibility i have a passcode and i tried to enter my password but it not working. help me please..
    i updated my ipad in ios 6

    Turn off VoiceOver
    1. Press the Home button
    2. Tap Settings.
    3. Then double-tap Settings.
    4. Tap General.
    5. Then double-tap General.
    6. Use three fingers on the screen to scroll to Accessibility
    7. Tap Accessibility.
    8. Then double-tap Accessibility
    9. Tap VoiceOver
    10. Then double-tap VoiceOver.
    11. Tap "On" next to VoiceOver
    12. Then double-tap "On" to turn it off.

  • Change Password link is not showing up in MyAccount Page

    Change Password link is not showing up in MyAccount Page, eventhough the line
    <class name="PasswordPortalSetting"/> is not commented out in DisplayPortalSettings.xml
    We are using custom Auth source and not using plumtree Auth source, Is this could be a reason?
    Any help is appreciated.

    I'm seeing the same thing as Simon, I changed the iOS device name in both places on an iOS device and the name in the Intune console is still "iPhone" which is really unhelpful as I'm sure you can imagine.  Is there some other place
    that we should be going to rename devices so they are more easily identifiable in the Intune console?
    Thanks!

  • No matter how many times I reet my password, it will not work when trying to sign intothe App Store through my iPhone4S.

    No matter how many times I reset my password, it will not work when trying to sign intothe App Store through my iPhone4S.

    What is the error that you are seeing? Try to login using another App like GameCenter or iMessage? Also try logging in to other Apps like Facebook to check if it is your Internet connection problem.

  • HT1414 my password lock is not working after my last upgrade

    I just upgraded my iPad and now my password lock is not working.

    Hi krburke,
    Welcome to the Support Communities!
    The article below may be able to help you with this.
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    I hope this information helps ....
    - Judy

  • Norton password manager does not work on 8. How do I return to a previous version?

    when I updated to firefox 8, Norton password manager does not work. How can I return to a previous version. I am surprised that you introduced an update missing this.

    Norton needs to be updated.
    http://community.norton.com/t5/Norton-360/Firefox-8-Support-for-Norton-Toolbar/td-p/581640

  • Itunes is not working on my mac. I'm trying to redeem a gift card and everytime I enter my password it does not work.  Also, when I try and browse songs, everything is blank

    HELP!
    Itunes is not working on my mac. I'm trying to redeem a gift card and everytime I enter my password it does not work.  Also, when I try and browse songs, everything is blank

    It's been a while but it should work on a Mac because Macs can read Windows formatted devices. Otherwise, you can perform a restore operation to return it to the Mac format. If you go to support.apple.com/manuals/ you can find a copy of the user manual for the model you have in which this is all explained.

  • Change Password on first use does not work properly.

    I have created apex application user in Oracle Apex 3.2 as follows
    BEGIN
    APEX_UTIL.CREATE_USER(
    p_user_name => 'NEWUSER1',
    p_web_password => 'secret99');
    END;
    As in the documentation
    p_change_password_on_first_use  IN      VARCHAR2    DEFAULT 'Y',
    User should be prompted to change password at first use. But it does not work properly. There is no such message. Still accepts user to log in with old passord that was first given to the user. I have tried explicitly to ensure change password at first log in. by
    BEGIN
    APEX_UTIL.CREATE_USER(
    p_user_name => 'NEWUSER1',
    p_web_password => 'secret99',
    p_change_password_on_first_use =>'Y');
    END;
    Still does not work. How can I ensure user to change password on first login.
    Hasan Al Mamun
    Programmer
    Bangladesh Bank
    Dhaka, Bangladesh

    Might be a long way around the problem but I would utilize a boolean flag in a column (FIRST_LOGIN) your custom auth table set to 'Y' when you create their account. Then on the login page have a page process something like:
    ** NOT TESTED **
    declare
    v_first VARCHAR2(10;
    v_session NUMBER;
    begin
    v_session := APEX_CUSTOM_AUTH.GET_NEXT_SESSION_ID;
    select FIRST_LOGIN into v_first from AUTH_TABLE where user_name = :P101_USERNAME and :P101_PASSWORD;
    if v_first = 'Y' then
    wwv_flow_custom_auth_std.login(
    P_UNAME => :P101_USERNAME,
    P_PASSWORD => :P101_PASSWORD,
    P_SESSION_ID => v_session,
    P_FLOW_PAGE => :APP_ID||':2' *** THIS IS YOUR PAGE TO HAVE THEM RESET THEIR PASSWORD ***
    else
    wwv_flow_custom_auth_std.login(
    P_UNAME => :P101_USERNAME,
    P_PASSWORD => :P101_PASSWORD,
    P_SESSION_ID => v_session,
    P_FLOW_PAGE => :APP_ID||':1' *** MAIN LOGIN PAGE *****
    EXCEPTION WHEN OTHERS THEN
    *** handled **
    end;
    The page 2 in this example would have an few items for them to enter their new password twice, a page process to update their password in the auth table and then redirect them to the intended first page.
    Not sure if it meets your setup.
    Ricker

  • The password features does not work. Open TB, and I can read my email without using the password. Why?

    I use a password for security. When I click onto TB, I do not have to use my password to read my emails or it will not download. I cannot figure out how to change my password. When I tried to set the master password,
    it claims to have confirmed the new one. But I have to use the old password, or I do not have to use a password at all to read my email, if it downloads. This is after I uninstalled and installed TB 24.4 three times.
    Now what, any ideas?

    Here is my understanding: the master password secures your saved passwords. In other works, it unlocks your password to connect to the server to send and receive mail. It doesn't prevent people who have access to your computer from opening Thunderbird and seeing what's already there.
    This article has an extended discussion of many methods to try to prevent others from reading your already downloaded mail: http://kb.mozillazine.org/Protecting_the_contents_of_the_profile_-_mail

Maybe you are looking for

  • HOW DO I Move time machine to a larger hard disk

    My time machine disk has two partions for the twp OS I am running --Snow leopard on internal and Lion on external disk Error message saying that there is not enough room toback up Lion. How to I move the contents of time machine to a larger disk?

  • Shared photo streams not transferring photos

    My shared photo stream was working fine, and then suddenly it wouldn't receive any photos from other users, and wouldn't send them my uploaded pictures? How do i get it to work again? I also got an email that someone subscribed but it never showed up

  • Both internal and USB mics not working

    Hi there, all. Long-time lurker, first-time poster. Starting last night, I have been having issues with microphone use on my iBook G4. Neither the internal mic nor my USB headset mic (Altec Lansing AHS302USB) are accepting input. The internal mic's f

  • Sending attachments from desktop

    Is there any way to send a document as an attachment right from the desktop? So, for instance, you're in a folder on a document and you want to send it as an attachment. Can one add a "send as attchment" option in the ctrl-click menu, or is there ano

  • MacBook wakes up from sleep when it shouldn't

    Especially MacBook Pro's with bigger screens tend to wake up if they get a little bit of pressure one the screen causing the keys to go down and wake the MacBook/MacBook Pro up. This can drain the battery making the MacBook unavailable for beeing use