Friday, May 22, 2009

Java Code to use SSO login

Q) How to bind java application to SSO i.e whenever someone tries to access application he is prompted for oracle SSO
A) Add the following code to first page of you application, and deploy you application to oas, your job is done.
String portalUser = request.getRemoteUser();
try
{
portalUser = request.getRemoteUser();
System.out.println(portalUser);
}
catch(Exception e)
{
portalUser = null;
}
if ((portalUser == null) (portalUser.length() <= 0))
{
response.sendError(499, "Oracle SSO");
}