Search code examples
oracle-databasesessionhttp-redirectauthenticationoracle-apex-5

Oracle Apex: redirect to the page user requested after login


I am using Oracle APEX 5.0 on Oracle 12c. I have a situation where a user opens a link to an apex page from his email and he is redirected to the login page because there is no session exists.

e.g. the link that user clicks is: http://host:port/apex/f?p=app_id:page:::::ITEM1,ITEM2:VAL1,VAL2

After clicking this link the user is moved to the login page. My question is after a successful login, how can we redirect him to the link he originally tried to access along with the parameters and values originally passed?


Solution

  • Yes, there's a way; follow this path:

    Edit application properties >> Security tab >> Session management >> Deep linking >> set it to "Enabled"

    From the documentation:

    This attribute enables or prevents deep linking to an application. Options include:

    • Enabled - The URL to a specific page ultimately redirects there, possibly after the user has to logged in.
    • Disabled - If the URL does not contain a valid session ID, Application Express redirects to the application's home page.

    For example, browsers often save the URLs of opened tabs and try to restore the sessions after a restart, causing a deep link. This behavior may be undesirable (for example if a URL points to a page in the middle of a multi-step wizard). By selecting Disable, Application Express starts a new session and redirects to the application's home page.

    Note you can override this application setting at page-level.