Search in sources :

Example 1 with AuthnContext

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;
}
Also used : AuthnStatement(org.opensaml.saml.saml2.core.AuthnStatement) AuthnContextClassRef(org.opensaml.saml.saml2.core.AuthnContextClassRef) AuthnContext(org.opensaml.saml.saml2.core.AuthnContext)

Aggregations

AuthnContext (org.opensaml.saml.saml2.core.AuthnContext)1 AuthnContextClassRef (org.opensaml.saml.saml2.core.AuthnContextClassRef)1 AuthnStatement (org.opensaml.saml.saml2.core.AuthnStatement)1