org.opensaml.saml2.core.impl.AuthnContextBuilder Java Examples
The following examples show how to use
org.opensaml.saml2.core.impl.AuthnContextBuilder.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AuthnStatementGenerator.java From MaxKey with Apache License 2.0 | 6 votes |
public AuthnStatement generateAuthnStatement(DateTime authnInstant) { //Response/Assertion/AuthnStatement/AuthContext/AuthContextClassRef AuthnContextClassRef authnContextClassRef = new AuthnContextClassRefBuilder().buildObject(); //urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport authnContextClassRef.setAuthnContextClassRef(AuthnContext.PPT_AUTHN_CTX); //Response/Assertion/AuthnStatement/AuthContext AuthnContext authnContext = new AuthnContextBuilder().buildObject(); authnContext.setAuthnContextClassRef(authnContextClassRef); //Response/Assertion/AuthnStatement AuthnStatement authnStatement = new AuthnStatementBuilder().buildObject(); authnStatement.setAuthnContext(authnContext); authnStatement.setAuthnInstant(authnInstant); logger.debug("generateAuthnStatement authnInstant "+authnInstant); return authnStatement; }
Example #2
Source File: SamlAssertionProducer.java From saml-generator with Apache License 2.0 | 6 votes |
private AuthnStatement createAuthnStatement(final DateTime issueDate) { // create authcontextclassref object AuthnContextClassRefBuilder classRefBuilder = new AuthnContextClassRefBuilder(); AuthnContextClassRef classRef = classRefBuilder.buildObject(); classRef.setAuthnContextClassRef("urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"); // create authcontext object AuthnContextBuilder authContextBuilder = new AuthnContextBuilder(); AuthnContext authnContext = authContextBuilder.buildObject(); authnContext.setAuthnContextClassRef(classRef); // create authenticationstatement object AuthnStatementBuilder authStatementBuilder = new AuthnStatementBuilder(); AuthnStatement authnStatement = authStatementBuilder.buildObject(); authnStatement.setAuthnInstant(issueDate); authnStatement.setAuthnContext(authnContext); return authnStatement; }