lschilde / Sharing_APEX_SERT_22_2

6 stars 0 forks source link

Launch URL #3

Closed omarsawalhah closed 5 days ago

omarsawalhah commented 1 year ago

Does the Launch URL still work?

lschilde commented 1 year ago

It should work if all is configured and installed correctly. I never had it not working. :)

andyhardy commented 1 year ago

I just get a session-expired message.

The installation instructions are missing the section around launcher part 2 - I assumed logging in as sv_sert_launcher and running the script?

I don't quite understand how the REST thinks it's going to validate the user - it seems to be looking for cookies in the SERT workspace rather than the callers?

lschilde commented 1 year ago

Yes I believe if you are missing on REST call you have two options:

  1. create it manually under Application Builder
  2. re-run the script under sv_sert_launcher schema (maybe you want to combine part1 and part 2) but you will get the point

Currently users are validated from a Cookie values - correct.

andyhardy commented 1 year ago

2. re-run the script under sv_sert_launcher schema (maybe you want to combine part1 and part 2) but you will get the point

Currently users are validated from a Cookie values - correct.

I installed apex-sert_launcher_part2.sql as the sv_sert_launcher user, but get the session expired message when I run the link from my development workspace.

I'm unclear about the cookie check - it seems to be looking to see whether the user has a builder cookie from the SERT workspace? If so, I assume that this means that I need to add users to that workspace and have them log in before running the link from another workspace? This is all a little confusing as the documentation for version 5 seems to suggest that no further work is required to run an evaluation on your own workspace applications?

-- Get the INSTANCE_ID
  select snippet 
  into l_instance_id 
  from sv_sec_snippets 
  where snippet_key = ''INSTANCE_ID'';

  -- Get the Builder Cookie value
  l_builder_cookie := owa_cookie.get (''ORA_WWV_USER_'' || l_instance_id);

  if l_builder_cookie.num_vals = 0 THEN
    -- Redirect if no Builder Cookie Found
    l_url := (''f?p=SERT:103:0'');
  else

as I don't have a builder cookie in SERT, I'm ending up on page 103 without a logged in session.

lschilde commented 1 year ago

Idea how you start APEX SERT is by having a link under application Builder as you login into your ordinary APEX workspace from there it should be able to start APEX SERT using REST call we are creating in that step.

There is no need for any user etc creating you are mentioning.

Option is also to start from scratch here... idea is with a successful installation none of these steps would be necessary. Since I am not sure if that worked for you or not it is hard to help now without seeing it what the actual problem is.

lschilde commented 1 year ago

Take the Oracle developer VM from OTN and install it there using auto_instal.sql script to see what I am talking about. Then you can try to debug yours.

AkikoOrenji commented 1 year ago

@andyhardy @omarsawalhah I had the session expired issue and it was because the SERT installation never competed correctly so the API wasn't fully running and auth wasn't being shared between the workspace and SERT. See the following for how i fixed it https://github.com/lschilde/Sharing_APEX_SERT_21_2/issues/1 When installed correctly and working you can access the SERT console by logging into the app workspace you will be auditing, open the browser developer tools, goto the console and run javascript:var launchSERT=window.open('sert/launch/' + $v('pInstance')); and press enter. This will pop a tab and take you to SERT.

andyhardy commented 1 year ago

@andyhardy @omarsawalhah I had the session expired issue and it was because the SERT installation never competed correctly so the API wasn't fully running and auth wasn't being shared between the workspace and SERT. See the following for how i fixed it lschilde/Sharing_APEX_SERT_21_2#1 When installed correctly and working you can access the SERT console by logging into the app workspace you will be auditing, open the browser developer tools, goto the console and run javascript:var launchSERT=window.open('sert/launch/' + $v('pInstance')); and press enter. This will pop a tab and take you to SERT.

@AkikoOrenji Thanks for the pointer: I spotted that earlier, but I'm still failing to get a session. It's a bit hard to tell when the installation completes correctly, the install log has an error referring to the faulty null.sql file and a no-data-found in sv_sec_data for SV_SET_COMPATIBILITY_MODE but neither looks like they would cause the installation to fail.

I think that I'll abandon this for the time being until I get more spare time to investigate what's going on.

lschilde commented 1 year ago

First error from that compatibility mode can be ignored and there is an issue in second 'replacement statement' script where end; is missing from my original code which is now being tested.

You can run this after the installation has run:

DECLARE 
 l_compatibility_mode varchar2(5);
BEGIN
 select snippet 
    into l_compatibility_mode 
  from SV_SERT_XXXXXX.sv_sec_snippets 
  where snippet_key = 'COMPATIBILITY_MODE'; 

SV_SERT_XXXXXX.sv_sec_import.attribute_value(
  p_attribute_key         => 'SV_SET_COMPATIBILITY_MODE',
  p_attribute_set_key     => 'DEFAULT',
  p_value                 => l_compatibility_mode,
  p_result                => 'PASS',
  p_active_flag           => 'Y'
  );
END;

But as you said none of this should cause you problems with starting it.

lschilde commented 5 days ago

closing ticket