How to have an e-mail link that accesses the APEX page without you connect again.

Greetings,

It is common in our applications APEX to send e-mail to a user with a link to a specific data line so that they can access the line and approve it. The user who receives the email is already connected to the application, but when they click on the link in their email, he is asked to open a session. How to do this?

Thank you, Tony

Published by: hidden on 5 July 2012 14:47

What you need is a custom page Sentinel installation that will detect if there is a session already valid and which then uses.
See {: identifier of the thread = 2283805} for a fantastic example of Patrick Wolf on the functions of sentry page. You will need to change to get a valid session, through apex_custom_auth.get_session_id.

For some tips, check out these blog posts
http://joelkallman.blogspot.be/2010/10/custom-authentication-scheme-for-Oracle.html
http://Zetetic.net/blog/2010/12/10/updating-page-sentry-for-Apex-40-upgrade.html
http://timnzblog.WordPress.com/2010/09/13/application-express-and-JanRain/

(from the last blog :) code example

FUNCTION PAGE_SENTRY
RETURN BOOLEAN
IS
    l_username VARCHAR2(512);
    l_session_id NUMBER;
BEGIN
    IF USER != 'APEX_PUBLIC_USER' THEN
        RETURN false;
    END IF;
     l_session_id := wwv_flow_custom_auth_std.get_session_id_from_cookie;
     -- check application session cookie.
     IF wwv_flow_custom_auth_std.is_session_valid THEN
         apex_application.g_instance := l_session_id;
         l_username := wwv_flow_custom_auth_std.get_username;
         wwv_flow_custom_auth.define_user_session(
             p_user => l_username, p_session_id => l_session_id);
         RETURN true;
     ELSE
         OWA_UTIL.REDIRECT_URL('f?p=RPXAUTH:LOGIN:'||
             nv('APP_SESSION')||
             '::::RETURN_APP_ID,RETURN_PAGE_ID:'||
             v('APP_ID')||
             ','||v('APP_PAGE_ID'));
     END IF;
     RETURN false;
END page_sentry;

Perhaps others have more recent links, but that's where you should look. I have not set myself up again, however, so I can't really be much more help on this.

Tags: Database

Similar Questions

Maybe you are looking for