DefaultIDPAccountMapper.java revision 3bbd7d6d1e10c73adffd33625525aa92e291d956
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 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: DefaultIDPAccountMapper.java,v 1.7 2009/10/28 23:58:59 exu Exp $
*
* Portions Copyrighted 2016 ForgeRock AS.
*/
/**
* This class <code>DefaultIDPAccountMapper</code> is the default
* implementation of the <code>IDPAccountMapper</code> that is used
* to map the <code>SAML</code> protocol objects to the user accounts.
* at the <code>IdentityProvider</code> side of the WS-Federation
* implementation.
* Custom implementations may extend from this class to override some
* of these implementations if they choose to do so.
*/
public class DefaultIDPAccountMapper extends DefaultAccountMapper
implements IDPAccountMapper {
public DefaultIDPAccountMapper() {
}
/**
* Returns the user's <code>NameID</code>information that contains
* account federation with the corresponding remote and local entities.
*
* @param session Session object.
* @param realm Realm where user resides.
* @param hostEntityID <code>EntityID</code> of the hosted provider.
* @param remoteEntityID <code>EntityID</code> of the remote provider.
* @return the <code>NameID</code> corresponding to the authenticated user.
* null if the authenticated user does not container account
* federation information.
* @exception WSFederationException if any failure.
*/
public NameIdentifier getNameID(
) throws WSFederationException {
try {
} catch (SessionException se) {
"invalidSSOToken"));
}
try {
String attrName = WSFederationMetaUtils.getAttribute(idpConfig, WSFederationConstants.NAMEID_ATTRIBUTE);
}
if (isBinaryAttribute(attrName)) {
}
} else {
}
}
}
} catch (DataStoreProviderException dspe) {
throw new WSFederationException(dspe);
}
}
// Need to get a domain from somewhere and append it to name2
// Try user profile first
{
try {
} catch (DataStoreProviderException dspe) {
throw new WSFederationException(dspe);
}
}
}
// Nothing on the user profile - get from config
}
{
// OK - now we have a problem
"noDomainConfigured",null);
}
} else {
}
try {
}
catch (SAMLException se){
throw new WSFederationException(se);
}
}
}