/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 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: ValidateSAML2.java,v 1.4 2009/11/20 22:45:57 ggennaro Exp $
*
* Portions Copyrighted 2014-2016 ForgeRock AS.
*/
public class ValidateSAML2 {
private boolean bFedlet = false;
throws WorkflowException {
validateIDP();
validateSP();
}
private void validateIDP()
throws WorkflowException {
try {
realm, idpEntityId);
}
if (idpMetaAlias != null) {
} else {
}
}
}
if (idpBaseURL == null) {
throw new WorkflowException("cannot.locate.idp.loginURL",
param);
}
} catch (SAML2MetaException ex) {
}
}
(SingleSignOnServiceElement) i.next();
if (loc != -1) {
}
}
}
}
return url;
}
private void validateSP()
throws WorkflowException {
try {
realm, spEntityId);
}
if (spMetaAlias != null) {
} else {
}
}
}
bFedlet = true;
} else {
}
} catch (SAML2MetaException ex) {
}
}
throws WorkflowException {
try {
} catch (MalformedURLException ex) {
} catch (IOException ex) {
}
}
(SingleLogoutServiceElement) i.next();
if (loc != -1) {
}
}
}
}
return url;
}
if (idx != -1) {
if (idx1 != -1) {
} else {
idpEntityId = idp;
}
} else {
idpEntityId = idp;
}
}
if (idx != -1) {
if (idx1 != -1) {
} else {
spEntityId = sp;
}
} else {
spEntityId = sp;
}
}
try {
} catch (MissingResourceException e) {
return null;
}
}
return idpEntityId;
}
return spEntityId;
}
return idpBaseURL + LOGIN_URL;
}
}
return idpBaseURL + LOGOUT_URL;
}
return spBaseURL + LOGOUT_URL;
}
public boolean isFedlet() {
return bFedlet;
}
public boolean isGoogleSP() {
if( this.spEntityId != null ) {
return true;
}
}
return false;
}
public boolean isSalesforceSP() {
if( this.spEntityId != null ) {
return true;
}
}
return false;
}
public boolean isIDPHosted() {
}
if (idpMetaAlias != null) {
try {
if (bFedlet) {
url += "?metaAlias="
+ "&spEntityID="
+ "&binding="
if( isGoogleSP() ) {
url += "&NameIDFormat="
} else if( !isSalesforceSP() ){
url += "&NameIDFormat="
}
return url;
} else {
return idpBaseURL + "/idpssoinit?metaAlias=" +
}
} catch (UnsupportedEncodingException ex) {
return "";
}
} else {
try {
return spBaseURL + "/spssoinit?metaAlias=" +
} catch (UnsupportedEncodingException ex) {
return "";
}
}
}
if (idpMetaAlias != null) {
try {
return idpBaseURL +
"/saml2/jsp/idpSingleLogoutInit.jsp?metaAlias=" +
} catch (UnsupportedEncodingException ex) {
return "";
}
} else {
try {
return spBaseURL +
"/saml2/jsp/spSingleLogoutInit.jsp?metaAlias=" +
} catch (UnsupportedEncodingException ex) {
return "";
}
}
}
if (idpMetaAlias != null) {
try {
return idpBaseURL +
"/saml2/jsp/idpMNIRequestInit.jsp?metaAlias=" +
"&requestType=Terminate";
} catch (UnsupportedEncodingException ex) {
return "";
}
} else {
try {
return spBaseURL +
"/saml2/jsp/spMNIRequestInit.jsp?metaAlias=" +
"&requestType=Terminate";
} catch (UnsupportedEncodingException ex) {
return "";
}
}
}
}