/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: FSPostLogin.java,v 1.6 2008/07/31 00:55:33 exu Exp $
*
*/
/**
* This class defines methods which will be invoked post
* Single Sign-On/Federation.
*/
public class FSPostLogin {
private boolean isIDP = false;
static {
}
/**
* Retreives and forwards request to URL after login.
*
* @param request <code>HttpServletRequest</code> object.
* @param response <code>HttpServletResponse</code> object.
*/
{
// this is for LECP, we need to map the random id back to
// original URL stored in session manager
if (relayStateURL != null) {
}
}
try {
} catch (FSPostLoginException fsexp) {
}
}
{
// means in middle of SSO show consent to introduction page
try {
+ "single cot present is " + cotSelected);
}
} else {
}
} else {
+ "COTS configured. redirecting to lrurl "
+ lrURL);
}
}
} catch (FSPostLoginException fsexp) {
}
} else if (showFederatePage != null &&
{
//show do u want to federate page with list of IDP's
return;
}
federationPage != null)
{
+ "provider(s) to federated with " + providerSet);
}
} else {
+ "provider(s) to federated with or "
+ "federationPage null. Redirecting to LRURL "
+ lrURL);
}
}
} else {
+ "Federatekey found");
}
}
+ returnURL);
}
}
/**
* Sets the Session Listener and session information.
*
* @param request the <code>HttpServletRequest</code> object.
* @param metaAlias the provider alias string.
*/
private void setTokenListenerAndSessionInfo(
{
try {
} catch(SessionException ssoExp) {
+ "Failed during trying to add token Listener:", ssoExp);
return;
}
"FSPostLogin::setTokenListenerAndSessionInfo. "
+ "No existing session found for user " + userID
+ " And SessionID: " + sessionID
+ " Creating a new Session");
}
}
}
/**
* Forwards request to the Return URL.
*
* @param request the <code>HttpServletRequest</code> object.
* @param request the <code>HttpServletResponse</code> object.
* @param returnURL the url to forward to.
*/
{
try {
"FSPreLogin:: sendError Error during sending error page");
}
}
/**
* Returns the introduction URL.
*
* @param request the <code>HttpServletRequest</code> object.
* @return a String the Introduction URL.
* @exception FSPostLoginException on error.
*/
throws FSPostLoginException
{
}
/**
* Retrieves the entityID of the provider.
*
* @param metaAlias the provider alias.
* @param request the <code>HttpServletRequest</code> object.
* @exception FSPostLoginException on error.
*/
throws FSPostLoginException
{
if (metaManager != null) {
try {
if (providerRole != null &&
{
isIDP = true;
} else if (providerRole != null &&
{
}
} catch (IDFFMetaException ie) {
}
} else {
+ "could not get alliane manager handle "
+ "Cannot proceed so throwing error page");
throw new FSPostLoginException(
"FSPostLogin:: could not get meta manager handle.");
}
}
/**
* Returns the Introduction Writer URL.
*
* @param metaAlias the provider alias.
* @param targetURL the url the writer servlet will redirect to.
* @param cotSelected the name of the Circle fo Trust.
* @return the writer url.
* @exception FSPostLoginException on error.
*/
throws FSPostLoginException
{
try {
if (metaManager != null) {
}
}
}
realm, cotSelected);
{
}
} catch (IDFFMetaException metaExp) {
"FSPostLogin::doConsentToIntro in cot managment expextion:",
metaExp);
} catch (COTException meta2Exp) {
"FSPostLogin::doConsentToIntro in cot managment expextion:",
meta2Exp);
}
}
+ redirectURL);
}
return redirectURL;
}
/**
* Returns the URL to which request should be redirected
* for federation. This method reads the request parameters
* and creates an Authentication Request to send to
* initiate the Single Sign-On / Federation process.
*
* @param request the <code>HttpServletRequest</code> object.
* @param response the <code>HttpServletResponse</code> object.
* @return the URL to redirect request to.
* @exception FSPostLoginException on error.
*/
throws FSPostLoginException {
+ metaAlias);
+ LRURL);
+ selectedProvider);
}
while(headerNames.hasMoreElements()) {
}
if (httpSession != null) {
}
try {
true);
} catch (FSLoginHelperException fsLoginExp) {
throw new FSPostLoginException("FSPostLogin::doFederate exception "
+ fsLoginExp.getMessage());
}
}
+ urlKey);
}
return urlKey;
}
/**
* Retrieves the value of a parameter from the URL. This is
* an utility method.
*
* @param reqURLStr the url string.
* @param name the value of the parameter to be retrieved.
* @return value of the parameter
*/
int iIndex =0 ;
{
int endOfString;
{
break;
}
}
}
return returnStr;
}
}