ADF Essentials includes all the key ADF technologies, only one is missing - ADF Security. This is related to ADF Security technical implementation dependency on WebLogic security. However, lack of ADF Security support is not a show stopper - we can enable JAAS security model. This would protect page resources from ADF application, but not ADF Task Flows with Fragments. One of the most common ADF architectures nowadays - use of ADF Task Flows with Fragments through dynamic regions based on single page. This means security implementation to protect ADF Task Flows with Fragments, when rendered through dynamic region is very important.
In this post I will provide solutions, implemented in the sample application - MultiTaskFlowApp_gfsec.zip for:
1. Configuring JAAS security for ADF application
2. Configuring ADF application for Glassfish security
3. Restricting access to ADF Task Flows with Fragments
Sample application contains SecurityController class - custom class, responsible to check if task flow can be accessed. Logic is pretty simple - we check current dynamic region task flow address, compare it along with a security check (globalaccess role). This is simplified example, in real life most likely you would retrieve mapping between task flow and security role from the database:
Now the key part - from where this logic is invoked. It is invoked from task flow activation property (conditional activation). This means, dynamic region will be activated only if task flow will be viewable (security access is granted) based on the custom security logic from our method above:
This is how we can control ADF Task Flow with Fragments access.
Now let's take a look how security infrastructure is configured for deployment. Firstly you need to define JAAS security constraint in web.xml:
As you can see here, all pages (/faces/*) are restricted to be accessed only for authorized roles. These roles are mapped with groups. Groups are defined on Glassfish server. This is the same concept as with WebLogic, only that we need to use glassfish-web.xml (create it manually) configuration file in WEB-INF where roles are mapped with groups:
We can test it now - login as redsam (GlobalUser):
Open task flow for Departments:
Login now as sking (RegionalUser):
This user doesn't have access to the Departments task flow, task flow will not be activated as per our security check implementation:
You can create local user in Glassfish, just in the same way as you do in WebLogic - go to file realm and press Manage Users:
You can manage users from here:
In this post I will provide solutions, implemented in the sample application - MultiTaskFlowApp_gfsec.zip for:
1. Configuring JAAS security for ADF application
2. Configuring ADF application for Glassfish security
3. Restricting access to ADF Task Flows with Fragments
Sample application contains SecurityController class - custom class, responsible to check if task flow can be accessed. Logic is pretty simple - we check current dynamic region task flow address, compare it along with a security check (globalaccess role). This is simplified example, in real life most likely you would retrieve mapping between task flow and security role from the database:
Now the key part - from where this logic is invoked. It is invoked from task flow activation property (conditional activation). This means, dynamic region will be activated only if task flow will be viewable (security access is granted) based on the custom security logic from our method above:
This is how we can control ADF Task Flow with Fragments access.
Now let's take a look how security infrastructure is configured for deployment. Firstly you need to define JAAS security constraint in web.xml:
As you can see here, all pages (/faces/*) are restricted to be accessed only for authorized roles. These roles are mapped with groups. Groups are defined on Glassfish server. This is the same concept as with WebLogic, only that we need to use glassfish-web.xml (create it manually) configuration file in WEB-INF where roles are mapped with groups:
We can test it now - login as redsam (GlobalUser):
Open task flow for Departments:
Login now as sking (RegionalUser):
This user doesn't have access to the Departments task flow, task flow will not be activated as per our security check implementation:
You can create local user in Glassfish, just in the same way as you do in WebLogic - go to file realm and press Manage Users:
You can manage users from here:




























