use of org.opensaml.saml.saml2.core.AuthnContext in project cas by apereo.
the class AbstractSaml20ObjectBuilder method newAuthnStatement.
/**
* New authn statement.
*
* @param contextClassRef the context class ref such as {@link AuthnContext#PASSWORD_AUTHN_CTX}
* @param authnInstant the authn instant
* @param sessionIndex the session index
* @return the authn statement
*/
public AuthnStatement newAuthnStatement(final String contextClassRef, final ZonedDateTime authnInstant, final String sessionIndex) {
final AuthnStatement stmt = newSamlObject(AuthnStatement.class);
final AuthnContext ctx = newSamlObject(AuthnContext.class);
final AuthnContextClassRef classRef = newSamlObject(AuthnContextClassRef.class);
classRef.setAuthnContextClassRef(contextClassRef);
ctx.setAuthnContextClassRef(classRef);
stmt.setAuthnContext(ctx);
stmt.setAuthnInstant(DateTimeUtils.dateTimeOf(authnInstant));
stmt.setSessionIndex(sessionIndex);
return stmt;
}
Aggregations