07 November 2011

Upgrade to APEX 4.1: Invalid Login Credentials

Always a good idea to upgrade on a Friday.. not... In the past I did numerous upgrades to the latest APEX release, and never really encountered big problems. It was always very smooth, kudos to the APEX-team. If something went wrong it was mostly my own fault, which I will admit now. Because of the history of going very smoothly, I dare to do an upgrade on Friday morning. And it did go smoothly, the upgrade to APEX 4.1 ... until...
Until I started up the application, then I got this "Invalid Login Credentials:
This had me scratching my head for a while.... For this application we are using a Custom Authentication and it turns out that we ran into bug number: 13045147. At the end of the day, I found a way that worked for me to get around this bug.
Before you start this, I strongly advise you to backup your application and everything else your fond of. This worked for me, hopefully it works for you.
Wait!.... There is a Patch for this bug:
... with a release date of November 7th,... coincidence?... ;)

Step 1. Copy your original Login Page (very handy to keep around in case you need to copy regions over)
This can easily be done if you navigate to your Login page, and choose Create > New Page as Copy
Copy it to you own application
Leave all the defaults in place (or at least that is what I did)

Step 2: Now you can remove your Login page.
When you remove your Login page, you will get a warning:
Choose "Permanently Delete Page".... did I already tell you to make a backup of your application before you start following these steps? This might be your last chance to do so.
Step 3: New authentication and new Login Page
Navigate to Shared Components
and choose "Authentication Schemes"
Create a new Authentication Scheme, based on a pre-configured scheme from the gallery
Choose Custom from the select list
Then you will see two additional regions on the page, where you specify the functions and procedures you want to use. Currently this application only uses a custom (table based) authentication, so I fill in the packaged function which I use
The signature of the function should look like this
   function validate (p_username in varchar2
                     ,p_password in varchar2
      return boolean;
When you complete this step, not only is the new Authentication Scheme created, but it is also the active one. And as a bonus, you will get a new Login page as well.
You can see it is the active Authentication Scheme, as it is labelled as "Current" in the Authentication Overview
After all these steps the authentication works as before, just restore (copy) the extra regions from the original Login page to the new Login page and we're all set.


  1. Hi,
    we published a one-off patch for bug 13045147 on Support yesterday. However, I'm curious: Can you give more details on the problem you encountered and what code misbehaved on your old login page?


  2. There's also a large item on the Apex OTN forum regarding this.

  3. Thanks, it's been many years, but it still keeps helping people.