Quick guide to use Oracle SSO with (ADF) web application
Written By: Pascal Alma on January 8, 2008
One Comment
In this post I show the steps it takes to secure an (Oracle ADF) web application by SSO as it is supplied with the Oracle Application Server.
- Step 1:Install standalone OC4J
- download it here
- Unpack it to your PC
- Set necessary environment variables
- Run first time and set password (see for more installation details the oc4j Readme file
- Step 2: Configure SSO in OC4J
- start management console of OC4J by browsing to 'http://localhost:8888/em/'
- open tab 'Applications'
- Start application 'java_sso' under 'Middleware Services' and 'Other Services'
- Step 3: Add new role to SSO realm
- goto tab 'Administration'
- Goto task 'Security Provider'
- Goto tab 'Realms'
- There should be one realm (jazn.com). Open the roles by clicking on the number of roles
- Create new role, say 'webuser'
- Go back to 'Security Provider' window and click on the number under 'Users'
- Create new user, say 'Pascal' identified by 'Alma' and grant the role 'webuser' to it.
- Step 4: Add security constraint to your web application
- Open web.xml
- Add the following at the bottom of the file:
-
<security-constraint>
-
<web-resource-collection>
-
<web-resource-name>All Faces</web-resource-name>
-
<url-pattern>/faces/pages/*</url-pattern>
-
</web-resource-collection>
-
<auth-constraint>
-
<role-name>webuser</role-name>
-
</auth-constraint>
-
</security-constraint>
-
<login-config>
-
<auth-method>
-
BASIC
-
</auth-method>
-
<realm-name>
-
jazn.com
-
</realm-name>
-
</login-config>
-
<security-role>
-
<description>The role a webuser has</description>
-
<role-name>webuser</role-name>
-
</security-role>
- Step 5: Deploy your application to the OC4J instance
- Build an .ear file of your application
- In the Enterprise Manager go to the tab 'Applications'
- Click the button 'Deploy' (or 'Redeploy' if you have deployed the application before)
- Browse to your .ear file and upload it to the OC4J server
- Give the application a proper name and accept all defaults
- After finishing this 'wizard' check the output in the log window for errors
- You can test your application by trying to access it in your browser
- If everything went well you will get a default browser window to enter your credentials. Remark: this is not yet the standard SSO login window!
- Step 6: Add your application to SSO
- On the home page of the OC4J Manager go to the administration tab
- Under 'Administration Tasks' and 'Properties' open the 'SSO Configuration' task
- In the 'Java SSO Configuration' screen select your application and add it to the SSO and click 'Apply'
- Restart the OC4J instance
XML:
If you now try to access your application in your web browser you will be redirected to the SSO login.
![]()
You can login with 'Pascal' and 'Alma'. So the web application is now protected by the (java)SSO of the Oracle application server.
Tags: Oracle iAS










[...] in OID. Now, I have used SSO before, but that was just the Java SSO of OC4J container (as described here). And this jSSO was based on a file-based sevurity provider. But now I have to use the Oracle SSO [...]