ADF Solution – Logout on Closing Browser

In this blog we will implement solution for problem of Handling Browser Close Event. Browser doesn’t send any event to the server to handle such events. The requirement is to logout and invalidate the user’s session when closing browser without logging out. This process is a part of application security, and it is important for performance improvement. The trick is to use ADF Bounded Task flow’s feature Run as Dialog. I will explain this technique.

I have developed sample application LogoutOnClosingBrowser.zip

in ADF (12.2.1.2.0).

We will go through this scenario:

When user starts application in the browser session created automatically.

User Login with Username & Password:

1

1) The Login button called bounded Task flow as Dialog in external-window.

Remember to change property useWindow=”true” in the Login button, which call task flow as dialog.

2

When user try to Logout from logout button, task flow execute After Listener to Invalidate Session and the logout action is working fine.

3

2) Configuring Finalizer to bounded task flow to handle Closing Browser Event.

4

We need to differentiate between two cases: Logout normally done from Logout button and Browser Closed.

Add <af:setPropertyListener> under the logout button, to send logoutFlag_P parameter equal true to Finalizer, if Logout action done from Logout button.

3(2)

 

3) Creating Security Bean and methods like this:

Logout Method: To handle Logout action.

5

Finalizer Method: To manage finalizing of the task flow.

6

Invalidate Session Method: To kill session after logging out.

7

To logout would be simply to close browser, and the user’s session will invalidate.

8

9

ADF 12c Workshop – HR Example

This blog is an Oracle ADF 12c Workshop, based on HR task, contain Technical information, tips and tricks of ADF development. I’d like to share it with you.

Workshop Overview

  • ADF Business Components generation
  • Add Calculated attributes to View object
  • Adding LOVs
  • Create New record before page load
  • Creating ADF Page Layout
  • Using Managed Beans
  • Add new record using ADF Bounded Taskflow
  • Search Functionality.
  • Sorting Data Dynamically (Run time)
  • Add Images to Application
  • Validation

I have developed this completed application HR_Example.zip.

in ADF (12.2.1.2.0).

The Page Example:

HR_Example

This view after page has been completed.

1

Search with LOVs

2

Snapshot of codes

4

I hope that this blog could help developers to build a better application based on ADF. If you have any questions i will be happy to answer you.