This content has been marked as final. Show 46 replies
If c.num_vals is 0 you would never get to:
:P160_USERNAME := a(1);
You would get the no-data-found exception at:
a := htmldb_util.string_to_table(c.vals(1));
If the your browser is not sending the cookie with the apex f?p request then the cookie most likely doesn't have path and/or domain attributes that would allow it to be sent to server:8090/apex. Try removing path=> '/' from the owa_cookie.send call. However if the eBS app is on a different host, you might have to include a domain argument also.
Scott, thank you for your reply.
I understand why I get the no-data-found error, no problem.
I have tried to remove path=> '/' with same negative result.
Could you clearify a little bit more about the domain parameter or point my to a location where I can read about it?
If both hosts are in the domain .mycompany.com then in the owa_cookie.send call add domain=>'.mycompany.com' (include the leading dot).
Also, see http://en.wikipedia.org/wiki/HTTP_cookie.
I added the domain parameter but I still have the same problem.
Is'nt there any hands-on solution on sending a cookie from one server to another or sombody that have come across this problem?
I'd need to see the code you use to set the cookie and the code you use to read it. Also, I'd need to know the domain and hostname in each case.
You know, you can examine cookie properties using browser tools after you send the cookie just to confirm your assumptions.
My bad...I missed to add domain in my OWA_UTIL.redirect_url, I just had the host name there.
Now I can read the cookie in my APEX app and I will continue with the solution.
Thank you for your sparring.
Back on this....
Is there somebody that have successfully implemented the solution described in?
Should I create a custom login page or use the default (that using my custom Authentication Scheme)?
In the white paper where it's described on how to create the application process (that reads the cookie) it says (page 5):
"This process should be conditional and should not be run if the login page is processing a logout request."
Does somebody know on how to achive this?
In my case my eBS is on one server and the APEX installation is on another server, I don't know if that's
what preventing it to work.
I'm trying to make a very simple proof of conecpt, my app only contain one login page (the default) and
one blank HTML-page. I have a database link between my APEX and EBS database (using APPS user). My
app works fine in a stand-alone scenario. But when I start it from EBS I get the login page (the appl.
process code has not fired) and if I tries to login using a username and a pwd I can se that the
appl. process fires and is reading the cookie correctly. The problem is that it "hangs" and it seems that
appl. process fires over and over again (can see that in my log table).
The Authentication Function
create or replace FUNCTION demo_ebiz_suite_auth
(p_username in VARCHAR2,
p_password in VARCHAR2) return BOOLEAN is
__return true; /* can log in with whatever */
Application Process - On load: Before header (page template header)
__demo_toLog('APEX process', '1');
__c := OWA_COOKIE.get('APEX_APPS_'||:APP_ID);
__a := htmldb_util.string_to_table(c.vals(1));
__:P101_USERNAME := a(1);
__:P101_PASSWORD := a(2);
__demo_toLog('APEX process', ':P101_USERNAME '||:P101_USERNAME);
__demo_toLog('APEX process', ':P101_PASSWORD '||:P101_PASSWORD);
__demo_toLog('APEX process', ':APP_ID '||:APP_ID);
__IF :P101_PASSWORD IS NOT NULL THEN
____demo_toLog('APEX process', 'before trying to login');
______P_UNAME => :P101_USERNAME,
______P_PASSWORD => :P101_PASSWORD,
______P_SESSION_ID => v('APP_SESSION'),
______P_FLOW_PAGE => :APP_ID||':1'
____demo_toLog('APEX process', 'after login');
__WHEN OTHERS THEN
____demo_toLog('APEX process', 'Fel: '||SQLERRM);
Maybe I'm doing some simple misstake here but I can't see it. I need a second opinion.
I created my own login page and use that instead of the one I got when I created the application. The behavior I get now is that the code (the application process) is executing when I call my APEX app from EBS but I get a HTTP 404 Not Found. The page not from comes from wwv_flow_custom_auth_std.login.
I think I get this error because EBS and APEX is on different servers. Is there anyway to solve this?
Check the Apache error log for more details about the 404 error.
Apache log file on the apex server - does not indicate the 404:
xx.xx.xx.xx - APEX_PUBLIC_USER [24/Oct/2007:10:48:46 +0200] "GET /pls/apex/f?p=111:1:::::: HTTP/1.1" 302 3188
xx.xx.xx.xx - APEX_PUBLIC_USER [24/Oct/2007:10:48:46 +0200] "GET /pls/apex/f?p=111:1:3898200361424701::::: HTTP/1.1" 302 3391
Apache log file on the eBS server - does indicate the 404:
xx.xx.xx.xx - - [24/Oct/2007:10:48:46 +0200] "GET /pls/UTV/OracleSSWA.Execute?E=%7B!3533356F4EF2FB69D1F58DC742C90148BCF9D7A5B06075F5&P= HTTP/1.1" 302 0
xx.xx.xx.xx - - [24/Oct/2007:10:48:46 +0200] "GET /OA_HTML/f?p=111:1:3898200361424701::::: HTTP/1.1" 404 215
I think what's happening is the following:
1. I click the link in eBs that calls my page 1 (that's what we see in the log file above)
2. Then the Application Processes is run and when wwv_flow_custom_auth_std.login is executed I get the 404.
3. This 404 is indicated by the eBS server which I really don't can understand
I'm really confused here. If I look in the eBS apache log file I understand that I got the 404 because
http://eBS-host.domain:port//OA_HTML/f?p=111:1:3898200361424701::::: does not exists, that is on
my APEX server.
Looks like it's doing a relative URL redirect based on the current GET from the OA_HTML path. Not sure why but you can try this: in your process, just before the call to the login procedure, do this:
:FSP_AFTER_LOGIN_URL := 'http://host:port/pls/apex/f?p=111:1:' || :APP_SESSION;
...or put whatever app/page is appropriate if 111:1 is not, just make it an absolute URL.
YES, it works :D
One last thing....
I need to have a condition on the app.process so it's not run on every page...cause it just runs and runs and I never get redirected eventhough everything else is correct if it's unconditional.
I tested to insert a row in a table after I got logged in (in the app process) and then did it conditional "NOT Exists (SQL query return no rows)":
select 1 from demo_log and it seems to work when I log in but it also fires when I log out the I get the infinte loop. I need a condition so it not fires on log out...
This works fine but then I have to handle the insert and delete in this table for every user and session , there have to be a better way...?
Isn't APP_USER set to the authenticated user name only if the process completes? So if :APP_USER not in ('APEX_PUBLIC_USER', 'nobody') /* and maybe other values */ you want to run the process.
Scott....I don't think I follow you last comment. Can you please clarify?
And....thank you again for you input.