use of com.sun.identity.federation.message.common.RequestAuthnContext in project OpenAM by OpenRock.
the class FSLoginHelper method getAuthnReq.
private FSAuthnRequest getAuthnReq(Map headers, String LRURL, boolean federate) throws FSLoginHelperException {
FSAuthnRequest authnRequest = null;
RequestAuthnContext authnContext = null;
List respondWithArray = new ArrayList();
List authnContextProfileClassRefArray = new ArrayList();
List authnContextStatementRefArray = new ArrayList();
try {
if (isLECPProfile(headers)) {
protocolProfile = IFSConstants.SSO_PROF_LECP;
} else if (isWMLProfile(headers)) {
protocolProfile = IFSConstants.SSO_PROF_WML_POST;
}
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("FSLoginHelper::getAuthnReq():" + "Federation profile is:" + protocolProfile);
}
if (respondWithString != null) {
StringTokenizer st = new StringTokenizer(respondWithString, ",");
while (st.hasMoreTokens()) {
String tmpString = (String) st.nextToken();
respondWithArray.add(tmpString);
}
} else {
respondWithArray = null;
}
authnContextProfileClassRefArray.add(authContextString);
authnContextStatementRefArray = null;
// this should be configurable
String authnContextComparison = IFSConstants.MINIMUM;
authnContext = new RequestAuthnContext(authnContextProfileClassRefArray, authnContextStatementRefArray, authnContextComparison);
String nameIDPolicyForReal;
if (!federate && nameIDPolicy.equals(IFSConstants.NAME_ID_POLICY_FEDERATED)) {
nameIDPolicyForReal = IFSConstants.NAME_ID_POLICY_NONE;
} else {
nameIDPolicyForReal = nameIDPolicy;
}
if (anonymousOnetime != null && anonymousOnetime.equals("true")) {
nameIDPolicyForReal = IFSConstants.NAME_ID_POLICY_ONETIME;
federate = true;
}
authnRequest = new FSAuthnRequest(null, respondWithArray, hostEntityID, forceAuthn, isPassive, federate, nameIDPolicyForReal, protocolProfile, authnContext, LRURL, IFSConstants.MINIMUM);
} catch (Exception ex) {
FSUtils.debug.error("FSLoginHelper.getAuthnReq():Error during procesing:", ex);
throw new FSLoginHelperException("FSLoginHelper.getAuthnReq() In Exception " + ex.getMessage());
}
return authnRequest;
}
Aggregations