HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpSession session = httpRequest.getSession();
request.setAttribute("ssoEnabled", "true");
SSOToken token = getToken();
String requestURI = request.getRequestURI();
// When token is not present and secured portal url is requested
if (isSecuredURI(requestURI) && token == null)
{
// Perform OpenSSO login by going to the OpenSSO authentication server
redirectToOpenSSOLogin(request, response);
return;
}
// When token present and valid
if (token != null && isTokenValid(token))
{
try
{
// Perform the portal JAAS authentication
String user = token.getProperty("UserId");
request.setAttribute("ssoSuccess", new Boolean(true));
Principal principal = ((Context) this.container).getRealm().authenticate(user, (String) null);
if (principal != null)
{
this.register(request, response, principal, getAuthType(), user,