/*
* 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: DefaultAccountMapper.java,v 1.4 2008/06/25 05:47:50 qcheng Exp $
*
* Portions Copyrighted 2015 ForgeRock AS.
*/
/**
* This class <code>DefaultAccountMapper</code> is a base class that the
* <code>DefaultSPAccountMapper</code> and <code>DefaultIDPAccountMapper</code>
* shall extend from this class. This class implements the common interface
* methods that are required for the SP and IDP account mappers and also
* provide some utility classes that can be shared between these mappers.
*/
public class DefaultAccountMapper {
static {
try {
metaManager= new SAML2MetaManager();
"failed", se);
}
}
/**
* Default constructor
*/
public DefaultAccountMapper() {
}
/**
* Returns the user's disntinguished name or the universal ID for the
* corresponding <code>SAML</code> <code>ManageNameIDRequest</code>.
* This method will be invoked by the <code>SAML</code> framework for
* retrieving the user identity while processing the
* <code>ManageIDRequest</code>.
* @param manageNameIDRequest <code>SAML</code>
* <code>ManageNameIDRequest</code> that needs to be mapped to the user.
* @param hostEntityID <code>EntityID</code> of the hosted provider.
* @param realm realm or the organization name that may be used to find
* the user information.
* @return user's disntinguished name or the universal ID.
* @exception SAML2Exception if any failure.
*/
) throws SAML2Exception {
if(manageNameIDRequest == null) {
"nullManageIDRequest"));
}
if(hostEntityID == null) {
"nullHostEntityID"));
}
"nullRealm"));
}
if (encryptedID != null) {
try {
final Set<PrivateKey> decryptionKeys = KeyUtil.getDecryptionKeys(getSSOConfig(realm, hostEntityID));
} catch (SAML2MetaException sme) {
}
} else {
}
if(debug.messageEnabled()) {
}
try {
} catch (DataStoreProviderException dse) {
" DataStoreProviderException", dse);
}
}
/**
* Returns the attribute value configured in the given entity
* SP or IDP configuration.
* @param realm realm name.
* @param entityID hosted <code>EntityID</code>.
* @param attributeName name of the attribute.
*/
if(debug.messageEnabled()) {
"null input parameters.");
}
return null;
}
try {
if(debug.messageEnabled()) {
" attribute configuration is not defined for " +
}
return null;
}
}
if(debug.messageEnabled()) {
attributeName + " is not configured.");
}
return null;
} catch (SAML2MetaException sme) {
if(debug.warningEnabled()) {
"Meta Exception", sme);
}
}
return null;
}
protected final BaseConfigType getSSOConfig(String realm, String entityID) throws SAML2MetaException {
} else {
}
}
}