LoginServlet.java revision 4930e4cc93a24188be6be13aca56c0ee6d4a73d5
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 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: LoginServlet.java,v 1.7 2009/03/14 03:50:43 manish_rustagi Exp $
*
*/
/*
* Portions Copyrighted 2011-2014 ForgeRock AS
*/
/**
*
*
*
*/
public class LoginServlet
/**
* Creates <code>LoginServlet</code> object.
*/
public LoginServlet() {
super();
}
// Set a view bean manager in the request context. This must be
// done at the module level because the view bean manager is
// module specifc.
// Check content length
try {
} catch (L10NMessageImpl e) {
if (debug.messageEnabled()) {
if (debug.messageEnabled()) {
+ e.getL10NMessage(locale));
}
}
throw new CompleteRequestException();
}
// Check whether this is the correct server to accept the client
// response.
//if cookie server does not match to this local server then
//send Auth request to cookie (original) server
if (debug.messageEnabled()) {
}
boolean isRoutingAllowed =
if(!isRoutingAllowed){
if (debug.messageEnabled()) {
+ ": Routing the request to distauth server " +
"with Login URL " + authCookieValue +
" is not allowed");
}
try{
" is not the trusted server</h1>");
} catch(IOException ioe) {
if (debug.messageEnabled()) {
ioe.getMessage());
}
}
try {
} catch(NumberFormatException nfe){
if (debug.messageEnabled()) {
nfe.getMessage());
}
}
throw new CompleteRequestException();
}
// check if the server to forward is a member of the local site
boolean isServerMemberOfLocalSite =
if (isServerMemberOfLocalSite) {
if (debug.messageEnabled()) {
}
try {
if (debug.messageEnabled()) {
}
throw fwdEx;
}
if (!origRequestData.isEmpty()) {
} else {
if (domainsList != null) {
response.addCookie(AuthClientUtils.createCookie(AuthClientUtils.getAuthCookieName(), "LOGOUT", domain));
if (debug.messageEnabled()) {
}
}
}
}
if (debug.warningEnabled()) {
+ "while forwarding request, throwing CompleteRequestException");
}
throw new CompleteRequestException();
}
}
if (contentType != null) {
} else {
}
}
if (debug.warningEnabled()) {
}
}
throw new CompleteRequestException();
} else {
if (debug.messageEnabled()) {
+ " local site; processing as normal");
}
}
}
}
}
if (domainsList != null) {
Cookie cookie = AuthClientUtils.createCookie(AuthClientUtils.getAuthCookieName(), "LOGOUT", domain);
if (debug.messageEnabled()) {
}
}
}
}
/**
* Returns url for auth module.
* @return url for auth module.
*/
public String getModuleURL() {
// The superclass can be configured from init params specified at
// deployment time. If the superclass has been configured with
// a different module URL, it will return a non-null value here.
// If it has not been configured with a different URL, we use our
// (hopefully) sensible default.
return result;
else
return DEFAULT_MODULE_URL;
}
/**
*
*
*/
throws ServletException {
// Do nothing
}
////////////////////////////////////////////////////////////////////////////
// Class variables
////////////////////////////////////////////////////////////////////////////
/** Default module uri. */
/** Confiured page name for configured servlet */
public static String PACKAGE_NAME=
private static final String UNTRUSTED_SERVER_ERROR_CODE =
"openam.untrusted.server.http.error.code";
// the debug file
private static final String DEFAULT_CONTENT_TYPE = "text/html; charset=" + G11NSettings.CDM_DEFAULT_CHARSET;
}