Not sure if I have hit a bug:
I am implementing SSO (via OAM) to application in Apex 4.2.2 running on Apex Listener 2.0 in Weblogic 10g.
I am using http header variable:
HTTP Header Variable Name: OAM_REMOTE_USER
URL: #CALLBACK#
Verify Username: Each Request
My Post Authentication Procedure Name : utils.sso_sentry
The code is
procedure sso_sentry
IS
n_hostname VARCHAR2(400):=NULL;
n_oam_remote_user VARCHAR2(1000):= NULL;
n_session_id NUMBER := NULL;
n_protocol VARCHAR2(1000):= NULL;
BEGIN
n_hostname:= OWA_UTIL.get_cgi_env('HOSTNAME');
n_oam_remote_user := OWA_UTIL.get_cgi_env('OAM_REMOTE_USER');
n_protocol := owa_util.get_cgi_env('REQUEST_PROTOCOL');
insert into test_table(item,value) values('oam_remote_user', n_oam_remote_user);
COMMIT;
APEX_CUSTOM_AUTH.SET_USER(n_oam_remote_user);
apex_authentication.send_login_username_cookie(p_username => lower(n_oam_remote_user));
n_session_id := APEX_CUSTOM_AUTH.GET_SESSION_ID_FROM_COOKIE;
INSERT INTO test_table(item,VALUE) VALUES('REQUEST_PROTOCOL', n_protocol);
COMMIT;
APEX_CUSTOM_AUTH.POST_LOGIN(
p_uname => n_oam_remote_user,
p_session_id => n_session_id,
p_app_page => '100:1');
OWA_UTIL.redirect_url('/apex/f?p=' || '100' || ':' || '1' || ':'||n_session_id||':');
end sso_sentry;
When run the application, I am going into the SSO page where I enter my username & password. Then after clicking login, I am redirected to page:
https://<myhostname>/apex/apex_authentication.callback?p_session_id=2035365908499&p_app_id=100&p_ajax_identifier=85C8EB491758A895E4A24EC9E2A58538E8C944B10C482A00A8501D58A3285C86
With the error message:
Error in PLSQL code raised during plug-in processing.
ORA-00036: maximum number of recursive SQL levels (50) exceeded
I am not sure why its recusrively running my post login procedure in a infinite recursive loop. Is this a bug or should I be doing anything different? Any help appreciated. Cheers.
Environment:
Apex 4.2.2 with OAM single sign on
Apex Listener 2.0