Apex 4.1 - Websheets with the custom authentication scheme

Apex v4.1 (as seen on the hosted apex.oracle.com) - Websheets do not always seem to work with a custom authentication scheme. Database applications work very well with a function of sentry page, but when the same page sentry function is used for a websheet, running, it gives an error the requested page was not found

One of the Apex team can consult? Thank you

Hi Vikas,

Websheet Sentinels have slight differences of sentinels of the application.
I created a sentinel websheet for you which should operate (see below).

Christian

create or replace function sample_page_sentry return boolean
is
    l_username   varchar2(512);
    l_session_id number;
    l_ws_app_id  number;
begin
    -- check to ensure that we are running as the correct database user.
    if user != 'APEX_PUBLIC_USER' then
        return false;
    end if;
    -- get sessionid in cookie
    l_session_id := wwv_flow_custom_auth_std.get_session_id_from_cookie;
    if wwv_flow_custom_auth_std.is_session_valid then
        -- the session still exists. we configure the APEX engine to use
        -- this session id and the session's username.
        --
        -- NOTE: it is more secure to also check if this is the session id from
        --       the URL!
        --
        apex_application.g_instance := l_session_id;
        l_username                  := wwv_flow_custom_auth_std.get_username;
        if nvl(l_username,'nobody') != 'nobody' then
            wwv_flow_custom_auth.define_user_session(
                p_user       => l_username,
                p_session_id => l_session_id);
            return true;
        end if;
    else
        -- session can not be reused, create a new one
        l_session_id := apex_custom_auth.get_next_session_id;
    end if;                                                                                 

    -- the current session is unauthenticated. we have to determine the user
    -- and log in.                                                                          

    -- get the username from somewhere, e.g. a cgi variable. it is hard-coded
    -- here for simplification.
    l_username := 'VANJ';
    -- configure the engine to use this username and session.
    apex_custom_auth.define_user_session(
         p_user       => l_username,
         p_session_id => l_session_id );
    -- build a deep link to the websheet start page
    l_ws_app_id  := apex_util.get_session_state ('WS_APP_ID');
    wwv_flow_custom_auth.remember_deep_link (
         p_url=>'ws?p='||l_ws_app_id||'::'||l_session_id );
    -- register the session in apex sessions table, set cookie, redirect back.
    apex_authentication.login(
         p_username => l_username,
         p_password => null );
    return true;
end sample_page_sentry;
/                                                                                           

Published by: Christian Neumueller November 15, 2011 07:07 (a wiki format error corrected)

Tags: Database

Similar Questions

  • Error after implementing the custom authentication scheme

    I have reproduced this time a workspace (GOGGINSCRATCH to apex.oracle.com) running 4.2.1.00.08 and a workspace 4.1.1.00.23 running

    Error: ORA-06550: line 4, column 23: PLS-00306: wrong number or types of arguments in the call to "AUTHENTICATOR" ORA-06550: line 4, column 1: PL/SQL: statement ignored

    PL/SQL in my workspace

    create or replace PACKAGE REPORTINGAUT AS

    function authenticator (user_name in VARCHAR2, pwd in VARCHAR2)
    return a Boolean value;

    END REPORTINGAUT;

    create or replace PACKAGE BODY REPORTINGAUT AS

    function authenticator (user_name in VARCHAR2, pwd in VARCHAR2)
    return a Boolean value AS
    BEGIN
    / * Implementation of necessary TODO * /.
    RETURN TRUE;
    END authenticator;

    END REPORTINGAUT;

    ------------------------------------
    APEX Builder Application steps
    (1) the shared components
    (2) the authentication schemes
    (3) create
    4.a) based on a system preconfigured Gallery
    4.b) name fred
    4.c) Type == custom
    Name of the function of authentication 4.d) = ReportingAut.authenticator
    4.e) activate the legacy of authentication attributes == Yes + (I've tried it both ways).

    So... this plan is underway, but when I try to connect, I get the above error... Driving me crazy... Thanks for any help...

    The parameter name is important. This should work:

    CREATE OR REPLACE PACKAGE reportingaut
    AS
       FUNCTION authenticator (p_username IN VARCHAR2, p_password IN VARCHAR2)
          RETURN BOOLEAN;
    END reportingaut;
    
    CREATE OR REPLACE PACKAGE BODY reportingaut
    AS
       FUNCTION authenticator (p_username IN VARCHAR2, p_password IN VARCHAR2)
          RETURN BOOLEAN
       AS
       BEGIN
          RETURN TRUE;
       END authenticator;
    END reportingaut;
    

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • APEX 5 - How to reset the default authentication in the admin module?

    Someone please help! I knew I could put the default authentication in the admin module, so I put it to use authentication custom LDAP that I created (which works in the apps I created in). Now I can't connect what either using the LDAP or APEX connection. I can't even log in the admin module. When I put the current authentication scheme, a pop-up message actually told me what is the procedure to use to reset to the default value, but of course that didn't save any where! DOH!

    Thank you

    Jen

    Just found the answer when you browse recent discussions. I swear, I'm not really looking for before this announcement, and it turned up nothing.

    In case someone needs the answer:

    begin apex_instance_admin.set_parameter ('APEX_BUILDER_AUTHENTICATION', 'APEX'); end;

    will reset back to the authentication of the APEX.

  • Change password with a custom authentication

    Hello

    I use a custom authentication scheme, which is a combination of authentication, ldap and apex. I created a function that checks in a user table to see if authentication_type is 'LDAP' or ' APEX. Depending on the type, be it authenticate against ldap or apex. It works very well. No problem.

    I also created a page for the password change functionality. This page has "new password" and "Confirm password" fields and a "submit" button. He also ' send' process that calls apex_util. CHANGE_CURRENT_USER_PW(:P43_NEWPASSWORD); to change the password for users of the apex.

    To change the password, the page gives the message that the password was changed successfully, but it actually doesn't change anything. I don't understand why?

    Help, please.

    Thnx
    Milan

    The user name is stored in uppercase in the user account. So what you could do is:

    declare l_user varchar2 (30);
    Start
    l_user: = v ('APP_USER');
    apex_application. G_user: = upper (l_user);
    apex_util. CHANGE_CURRENT_USER_PW(:P43_NEWPASSWORD);
    apex_application. G_user: = l_user;
    end

    Scott

  • LOV cascading if I don't have only one table with the customer name and the name of the product in the ADF.

    Hi Please help me how to use cascade, if I don't have only one table with the customer name and the name of the product in the ADF... I use Jdeveloper 11.1.

    For the client, I used customer VO with client list to fill but to populate the product that I use bind variable PrODUCT_NAME select distinct from TABLE where client_name =: bindCustomer

    so first of all, I need to set the variable of liaison on behalf of the selected customer.

    Can you please tell me how to set this variable binding in this case.

    After you set the LOV to your product attribute, correspondting VO in the LOV will appear under view accessors.

    Change the accessor of the view, you will see the variable binding. Set its value to the customer field of the parent object.

    Visit this link: https://www.youtube.com/watch?v=nXwL2_RP7AQ

    Kind regards

    Elias.

  • can I install CS5 on my laptop if 2 people already use the creative suite? I've now been referred to as forums after talking with the customer service and technical support online

    can I install CS5 on my laptop if 2 people already use the creative suite? I've now been referred to as forums after talking with the customer service and technical support online

    I was told they are separated once and also says to check the forums?

    Yes you can.

    ~ Rohit

  • I start on the site where I bought Adobe After Effects. Then I pressed 'Download', but the site you get on says (translated from English): there are problems, try again later. Get in touch with the customer, if the problem keept going. "While it

    I start on the site where I bought Adobe After Effects. Then I pressed 'Download', but the site you get on says (translated from English): there are problems, try again later. Get in touch with the customer, if the problem keept going. "So, here am I, I really hope someone knows the answer...

    Thank you

    Are you referring to CC version After Effects?

    If so, you must download and install Adobe Creative Cloud app using whiuch, you can install after effects CC.

    Windows:

    https://ccmdls.adobe.com/AdobeProducts/KCCC/1/Win32/CreativeCloudSet-up.exe

    Mac:

    https://ccmdls.Adobe.com/AdobeProducts/KCCC/1/OSX10/CreativeCloudInstaller.dmg

    Reference:

    Download and install Adobe Creative Cloud apps

  • Settings RDP with the customer to view.

    Hi all.

    Is it possible to change the RDP with the customer to display settings (resolution, colors,...) as the RDP of Windows client as it allows? View Client has just 2 options (port connection and SSL or not) by default.

    Thanks in advance.

    Sincerely,

    Jean-Philippe

    Yes you can do it.

    You can use the standard GPO in the ad and you'll find ADM files on the Server View Manager: C:\Program Files\VMware\View Manager\Extras\GPO

    Blog: http://communities.vmware.com/blogs/dommermuth

  • Urgent: how to integrate the SOUL with the custom of the OPS form?

    Hello

    One is to have the idea of integrating the TEA with the custom of the OPS form? Please provide the solution if it is possible. The requirement is to initiate the approval using the SOUL of the irecruitement customization form.

    Kind regards
    Ashish

    Hi Ashish,

    SOUL is called from the workflow - you need to open the workflow or pl/sql calls using wf_engine or by outbreak of corporate event (I dunno how to initiate this workflow).

    Kind regards
    Gareth

  • applicationContext remains "null" after using the custom url scheme to launch the app

    Hello

    I am currently working on a DPS application for a customer who wishes to use its own authentication system.

    The client system is implemented so that they send the valid token to a URI with a custom method.

    By setting the same pattern custom in my app DPS constructor, I can get the app from the login window.

    What is described in the library of DPS & Api store 2.32 documentation, I understand that

    " adobeDPS.configurationService.applicationContext must contain several variables associated to how the viewer was started or enabled:" ","this class represents the context under which the application is launched '


    However, in my application when I try to see what contains the applicationContext, the object is always 'null '. It doesn't matter if I started the application by clicking on its icon or if it was launched using the custom uri scheme.


    Is this a bug or am I missing something here? I really need this token.

    Hello

    After being stuck for a while trying to work with the url of my client for usage, I finally tested it with a modified version and have found the cause of the problem.

    Work of first information provided by a colleague who was apparently not detailed enough for the customer asked me to use a url of the form App. scheme://auth/#token=...

    It turns out that this kind of url can start or bring the app to the front, but applicationContext remains empty.

    My tests using a url in the same form as you suggested (eg. app. scheme://v1/slot/library) can trigger the app or transmit data.

    The documentation available in the SDK library & shop and article on how to use a custom template is very vague on what formats link actually works, and how we can vary with it.

    A breakdown of official links to pieces, that the parties do and what items can be modified (for example ' / appstate') within the API documentation would be a great help for developers, I think.

    Kind regards

    Lorin

  • Need help-> custom authentication scheme

    Hey,.

    I am working on a custom authentication scheme.

    First, I create a test table:
    CREATE TABLE TBL_USER
      (
        USR_EMAIL VARCHAR2(40 BYTE) NOT NULL ENABLE,
        USR_ID    NUMBER NOT NULL ENABLE,
        USR_PW    VARCHAR2(255 BYTE) NOT NULL ENABLE,
        USR_ROLLE VARCHAR2(20 BYTE),
    CONSTRAINT "TBL_USER_PK" PRIMARY KEY ("USR_ID")
    );
    Then a function to hash the email and pw:
    create or replace
    function app_hash_test (p_email in varchar2, p_passwort in varchar2)
    return varchar2
    is
      l_passwort varchar2(4000);
      l_salt varchar2(4000) := 'DFS2J3DF4S5HG666IO7S8DJGSDF8JH';
                                
    begin
      l_passwort := utl_raw.cast_to_raw(dbms_obfuscation_toolkit.md5
      (input_string => p_passwort || substr(l_salt,10,13) || p_email ||
        substr(l_salt, 4,10)));
      return l_passwort;
    end;
    Then, a function of authentication:
    create or replace
    function app_auth_test (p_email in VARCHAR2, p_passwort in VARCHAR2)
    return number
    is
      l_passwort varchar2(4000);
      l_stored_passwort varchar2(4000);
      l_expires_on date;
      l_count number;
    begin
      select count(*) 
        into l_count 
        from tbl_user 
       where upper(usr_email) = upper(p_email);
    
      if l_count > 0 
      then
        select usr_pw 
          into l_stored_passwort
          from tbl_user 
          where upper(usr_email) = upper(p_email);
    
        l_passwort := app_hash_test(p_email, p_passwort);
    
        if l_passwort = l_stored_passwort 
        then
          return 1;
        else
          return 0;
        end if;
      else
        return 0;
      end if;
    end;
    After this, I create a form on the table tbl_user to insert the users by e-mail, password and rol (drop-down).

    On this Page (3), I create a new process to generate the hash value.
    begin
    :P3_usr_email := upper(:P3_usr_email);
    :P3_usr_pw := app_hash_test(:P3_usr_email,:P3_usr_pw);
    :P3_usr_email := lower(:P3_usr_email);
    end;
    After completing my page reg., I insert some users to test it later.

    The next step was to create a new authentication scheme in the shared components.
    Share components
    1. create
    2 starting at zero
    3. name-> TBL_USER
    4 JUMP
    5 JUMP
    6. the Page of this Application-> Page 1
    7 JUMP
    8 use my custom function to authenticate. -> return app_auth_test
    9 JUMP
    10 JUMP
    11 LOGOUT URL-> wwv_flow_custom_auth_std.logout? p_this_flow = APP_ID. & amp; p_next_flow_page_sess = & APP_ID.:1
    12. create schema

    My next step is to set the new regime as current-> current change

    I'm trying to open a session to my existing page with an e-mail and password in the tbl_user table.

    But all I got, is an error message:

    ORA-06550: line 2, column 8: PLS-00306: wrong Anzahl oder Typen von illuminated by von call 'APP_AUTH_TEST' ORA-06550: 2 line, column 1: PL/SQL: statement ignored

    ERR Fehler - 10460 implement von Funktion zum Prufen der Authentifizierungs-ID-Daten nicht possible.

    Translattion:
    Wrong number or type of argument in the call to 'APP_AUTH_TEST' ORA-06550: 2 line, column 1: PL/SQL: statement ignored

    Error ERR-10460 perform the function of evidence authentication-ID data - is not possible.

    I have check the operation, but it seems ok!
    does anyone know, what I forgot? Perhaps some parameters in the Login Page?

    NEDO

    Edited by: Mr.Nedo the 12.04.2011 07:55

    Your authentication (app_auth_test) matching mist signature exactly as shown in the window help or documentation.

    function app_auth_test (p_email in VARCHAR2, p_passwort in VARCHAR2) RETURN NUMBER

    differs from the documentation

    (p_username in varchar2, p_password in varchar2) return a Boolean value

    Change function app_auth_test so that it matches with the signature expected (return type and the parameter names and types) or write a wrapper for him with this signature and use that work more like authentication.

  • Custom authentication scheme

    Dear community,

    I tried to create a custom authentication scheme based on a tutorial. But seemed to fail since the tutorial works on version 4.0 and I'm working on 4.1.

    Step 1. create table user_repository)
    username varchar2 (8).
    VARCHAR2 (8) password,.
    primary key (username)
    );

    Step 2 insert into user_repository values ('John', '1234');

    Step 3.

    create or replace package pkg_auth as
    function authenticate (p_username in varchar2,
    p_password in varchar2) return Boolean;
    end;

    create or replace package body pkg_auth as
    function authenticate (p_username in varchar2,
    p_password in varchar2) return Boolean is
    v_result integer: = 0;
    Start
    Select 1
    in v_result
    of user_repository
    where username = lower (p_username)
    and password = p_password;
    Return (v_result = 1);
    exception
    When no_data_found then
    Returns false;
    end to authenticate;
    end;

    Step 4. They want to create an authentication scheme from scratch, which does not exist in 4.1 (so it fails pretty well by already). I created a (based on some configs by default) normal authentication scheme.

    Step 5 They want to fill me this service "customized to authenticate": return pkg_auth.authenticate;
    Unfortunenately this functionality is not there either.


    Theyre talking passhashing, who used to work since I don't even get the normal authentication scheme to work.
    If someone could help me to create a custom authentication scheme based on the table in * 4.1, that wouldve was awesome.

    Authentication and authorization have been cleaned up to 4.1

    Create a schema of authentication "based on a pre-configured gallery system", and then select the type of theme of "custom".
    You can place your pl/sql code in the source field, or keep it in your database.
    Set your pkg_auth.authenticate in the field "name of the function of authentication.

    Final note - you should not really store plaintext passwords - I hope that this example of coding has been for the demo only. Check the past of examples that use the custom_hash function, for example.

    Scott

  • listener authentication AAA with the custom login page

    Hello

    is it possible to customize the page of connection on an ASA 5520 8.2 (1) that appears when you use the "listener authentication aaa" by adding images? I know that there is the command 'auth-guest' but it only allows to add text. Is there a form any HTML that allows the inclusion of the gif, bmp or jpg?

    Any hint is appreciated.

    Carpet

    Hi Matthias,

    officially, this is not possible. There is an improvement for this request:

    CSCsh02789    Improvement: Ability to customize the page of connection through proxy cut

    So you can open a TAC case and ask to link to the application (to add a little more weight) or contact your account team and ask them to talk to the business unit (to add more weight).

    That said, there is a possible hack you might want to try:

    for example, I have configured:

    AUTH-guest guest Please loghttp://myserver/image.gif' > '.

    and it shows the picture below to the command prompt. So it is a hack of course not supported, so it can break in future versions. And of course, it's pretty limited in what you can do.

    Now, if you disable the listener, for HTTP, it will use basic browser (no login form) authentication, but for HTTPS, it will use always a form, but a much more basic, so you can always use the same hack with a little more flexibility.

    HTH

    Herbert

  • Custom authentication scheme, problem with LOGOUT_URL

    Hi all
    I use a custom database of authentication scheme in a 4.1 application. I have a problem when I logout, I use jQuery mobile because it is a tablet based application, and the navigation bar entry "Logout" is rendered using the following: -.

    a href = "& LOGOUT_URL." data-icon = "Logout" class = "interface user-btn-right" > logout ' "

    The application appears disconnected OK, I turned around to my 101 login page, but when I try to reconnect the page refreshes just, if I try again to connect, I'm connected to OK (so basically users will have to try twice to reconnect after disconnection, while the connection when the application is started first works OK).

    When I logout and I return on page 101, the URL is: -.

    < my host > /pls/apex/apex_authentication.logout?p_app_id=1000 & p_session_id = 882879595907101

    After the first attempt to connect to the URL is (so the session ID has been updated);

    < my host > / pls/apex/f? p = 1000:LOGIN:1610821365546101

    Any ideas what I'm missing here?

    Thank you

    Mike

    Published by: Mike, UK 21 June 2012 08:36

    Hi Mike,.

    I replied the same day. In case you have not received my mail, I'll paste it below:

    What I've discovered, is that submit it on the login page seems to use the old session id:

      1. User enters http://mike/pls/apex/f?p=1150:1
         -> Apex creates a new session and redirects to
            f?p=1150:LOGIN:168921246845801
      2. User enters credentials and presses Login
         -> wwv_flow.accept with p_instance=168921246845801
         -> Apex authenticates user and redirects to page 1
            f?p=1150:1:168921246845801:::::
      3. User clicks Logout
         -> apex_authentication.logout?p_app_id=1150&p_session_id=168921246845801
         -> Apex removes session
         -> Apex redirects to home page f?p=1150:1
         -> Apex creates new session and redirects to login
            f?p=1150:LOGIN:1175456815657401
      4. User enters credentials and presses Login
         -> wwv_flow.accept with p_instance=168921246845801 -- WRONG SESSION ID!
         -> Apex sees that the session id and the session cookie value do
            not match
         -> Apex creates a new session and redirects to login
            f?p=1150:LOGIN:652507970485801
    

    My solution to this problem was to change the page to page 1 model to
    have one

    data-ajax = "false".

    attribute on the logout url. This seems to have done the trick, but I'm
    a backend guy and certainly not an expert in the user interface. See

    http://jquerymobile.com/test/docs/pages/page-links.html

    for help online JQM.

    See you soon,.
    Christian

  • Unable to connect with the customer to view

    Hello

    I can connect to my first machine winXP with rdp, but the customer view told me that there is a connection error (error http, status = 400). In the "server connection", I used my ESX host's IP address.

    What does poorly or describing what it takes to make this work?

    Thank you very much

    Malta

    Sorry, just to clarify, the connection to the server is a Windows Server (may be virtual) who has the login server software installed. It's in its web interface that you configure all the settings for your desktops, your pools of desktop computers and users or groups have the right to use them. Although view uses rdp to connect protocol client to view isn't just a remote desktop client.

    You also need the view-agent installed in the virtual desktop machine, you want to connect.

    Once you point the client to connect to the server, it displays all the virtual desktop that took the user with that right you authenticated. The administrator is not automatically or the right to use any desktop PC, you must manually set the rights.

Maybe you are looking for

  • Envy of HP dv6 7229 windows 8 for windows 7 lost drivers

    I have a HP Envy with i7-3630QM processor 7229nr dv6. I have downgraded from 8 to 7 PRO but forgot to save drivers so now have no network controller, etc. What should do?

  • How to remove widgets on the homescreen?

    This is the first time that I've never owned a smart phone, trying to learn how to fully use this phone. Then a few when say how to remove widgets according to the information from the display and any other House you think all I could use.

  • Extraction of 2 x 2 table from 10 x 10 array using only for loops

    Hi all I have this assignment for "pattern matching" - user enters the Boolean model 2 x 2, and I have to compare and find in the bigger picture of Boolean random 10 x 10.I managed to do it with the table palette, but my instructor alert me that for

  • battery drain empty

    compared to my iPad, my TPT drains a lot of battery when idle. I found a seting sleep wifi, I placed 15 minutes away, and that helps a lot. does he want to say that when he wakes up he takes a b for your email to sync, but sure beats losing battery w

  • latency on startup

    I had problems with my system when I bought a WD My Book Essential 1 TB external hard drive. When I disabled the Legacy USB support I was able to boot windows xp pro without any problem. Also told me to move my HHD to the top of the order of BIOS. Ye