use of com.sun.identity.saml2.assertion.NameID in project OpenAM by OpenRock.
the class DefaultAccountMapper method getSearchParameters.
/**
* Returns the <code>NameIDInfoKey</code> key value pair that can
* be used for searching the user.
* @param nameID <code>NameID</code> object.
* @param hostEntityID hosted <code>EntityID</code>.
* @param remoteEntityID remote <code>EntityID</code>.
* @exception <code>WSFederationException</code> if any failure.
*/
protected Map getSearchParameters(NameIdentifier nameID, String realm, String hostEntityID, String remoteEntityID) throws WSFederationException {
if (nameID == null) {
throw new WSFederationException(bundle.getString("nullNameID"));
}
NameIDInfoKey infoKey = null;
try {
infoKey = new NameIDInfoKey(nameID.getName(), hostEntityID, remoteEntityID);
} catch (SAML2Exception se) {
throw new WSFederationException(se);
}
HashSet set = new HashSet();
set.add(infoKey.toValueString());
Map keyMap = new HashMap();
keyMap.put(AccountUtils.getNameIDInfoKeyAttribute(), set);
if (debug.messageEnabled()) {
debug.message("DefaultAccountMapper.getNameIDKeyMap: " + keyMap);
}
return keyMap;
}
use of com.sun.identity.saml2.assertion.NameID in project OpenAM by OpenRock.
the class DefaultSubjectProvider method createNameIdentifier.
private NameID createNameIdentifier(String subjectId, String nameIdFormat) throws TokenCreationException {
NameID nameID = AssertionFactory.getInstance().createNameID();
try {
nameID.setValue(subjectId);
nameID.setFormat(nameIdFormat);
} catch (SAML2Exception e) {
throw new TokenCreationException(ResourceException.INTERNAL_ERROR, "Exception caught setting NameID state in DefaultSubjectProvider: " + e, e);
}
return nameID;
}
Aggregations