Hi Guys,
Note 1 : Before I explain my scenario, a note that "132456789" in the subject line, and referenced below is a place holder for my security_group_id ( I don't want to put my actual one on the forum).
Note 2 : I'm using Apex 18.2
Okay so,
I have been tasked with a project to automatically login a user into an apex application using a custom authentication scheme.
I have generated my auto-login URL which consists of a token. The URL looks something like this :
http://10.95.121.20:7061/ords/f?p=12550:1:::YES::&X01=TOKEN:424A474543484A48462D4748464A4644422D30472D574B392D433043302D
I am using a regex to find &X01=TOKEN:, the value there after is my encrypted token which I am verifying within a sentry function. If sentry succeeds then proceed to login me in, else return to my login page.
However when I am trying to access the URL I receive an "Internal Error Contact your application administrator. Details about this incident are available via debug id "586434". " on the front end - So i added in some apex debug messages to see what's going on and i've discovered this :
check session integrity: security_group_id mismatch "" vs "132456789" vs "132456789"
I had thought that the security group ID is not set for some odd reason (Due to the " ") so i attempted to get my security group ID, then set it, then proceed to define my session
Here's the end snippet of my sentry function, it dies after this is executed :
w_security_group_id := APEX_UTIL.FIND_SECURITY_GROUP_ID (p_workspace=>'WORKSPACE_NAME');
apex_debug.message(' MYB w_security_group_id : ' || w_security_group_id ); -- This print my w_security_group_id
APEX_UTIL.SET_SECURITY_GROUP_ID (w_security_group_id);
apex_debug.message(' MYB After setting w_security_group_id : ' || w_security_group_id );-- This print my w_security_group_id
APEX_CUSTOM_AUTH.DEFINE_USER_SESSION (
w_username,
w_session);
apex_debug.message('MYB After initialize the session');-- This prints then it login attempt dies
return true;
'MYB After initialize the session' does get hit and then my login dies with the same error message stated above.
Does anyone know how I can overcome this issue? How do i go about setting the "" which is stated in the error message check session integrity: security_group_id mismatch "" vs "132456789" vs "132456789" ?
I've done quite a bit of hunting for a solution however i'm stumped.
I hope that someone can assist.
Thanks in advance !
Kind Regards,
MY.