Basic Flow of Business Processing Plug-in

11-4 Oracle Fusion Middleware Administrators Guide for Oracle Identity Federation For details about the environment configuration, see Setting Up Environment Variables in the Oracle Fusion Middleware Administrators Guide.

11.4 Configuring JavaEE Security

Update the WebLogic policy file which resides in this location: OracleMiddlewarewlserver_10.3serverlibweblogic.policy Add these lines to the file: grant codeBase file:{user.domain}lib- { permission java.security.AllPermission; }; grant codeBase file:homeoracleOracleMiddlewareuser_projectsdomainsIDMDomainlib- { permission java.security.AllPermission; };

11.5 Example of Plug-in and Redirect Page

A sample plug-in might look like this: package oracle.security.fed.plugins; import java.net.URLEncoder; import java.util.Set; import java.util.HashSet; import oracle.security.fed.plugins.bizops.BusinessProcessingConstants; import oracle.security.fed.plugins.bizops.BusinessProcessingException; import oracle.security.fed.plugins.bizops.ListenerResult; import oracle.security.fed.plugins.bizops.OperationData; import oracle.security.fed.plugins.bizops.OperationListener; import oracle.security.fed.plugins.bizops.OperationTypes; in this example, the plug-in will redirect the user to an external page the first time a user creates a persistent federation. Later on, if the user creates another federation with the same provider or another one, the plug-in will not redirect the user anymore. Note: restarting the server will wipe out the cached information from the plug-in, resetting the data indicating whether or not any user was already redirected to the external page. public class BusinessProcessingSample implements OperationListener { private Set licenseAgreements = new HashSet; public ListenerResult processint operationType, OperationData params throws BusinessProcessingException { ListenerResult result = new ListenerResultBusinessProcessingConstants.STATUS_OK; switchoperationType { case OperationTypes.BUSINESS_IDP_CREATE_PERSISTENT_FEDERATION: String userid = Configuring Oracle Identity Federation for the Business Processing Plug-in 11-5 params.getStringPropertyBusinessProcessingConstants.DATA_STRING_USERID; if licenseAgreements.containsuserid { redirect to remote page result.setStatusBusinessProcessingConstants.STATUS_ REDIRECT; StringBuffer sb = new StringBuffer; sb.appendhttp:WEB-SERVER-HOST:WEB-SERVER-PORTbusinesstest.jsp?providerid=; sb.appendURLEncoder.encodeparams.getStringPropertyBusinessProcessingConstants.D ATA_STRING_PROVIDERID; sb.appenduserid=; sb.appendURLEncoder.encodeparams.getStringPropertyBusinessProcessingConstants.D ATA_STRING_USERID; result.setRedirectURLsb.toString; add the user to the license agreement set licenseAgreements.adduserid; } break; } return result; } } Here is a sample redirect page: page language=java import=java.net. Set the Expires and Cache Control Headers response.setHeaderCache-Control, no-cache; response.setHeaderPragma, no-cache; response.setHeaderExpires, Thu, 29 Oct 1969 17:04:19 GMT; String providerid = request.getParameterproviderid; String userid = request.getParameteruserid; String refid = request.getParameterrefid; String returnurl = http:OIF-HOST:OIF-PORTfeduser?refid= + URLEncoder.encoderefid; html body License Agreeement approved for: ProviderID = =providerid BR UserID = =userid BR a href==returnurlClick here to resume flowa body html