final List<String> authnContexts = new ArrayList<>(); for (final AuthnStatement authnStatement : authnStatements) { if(authnStatement.getAuthnContext().getAuthnContextClassRef() != null) { authnContexts.add(authnStatement.getAuthnContext().getAuthnContextClassRef().getAuthnContextClassRef());
protected List<AuthenticationStatement> getAuthenticationStatements( List<AuthnStatement> authnStatements ) { List<AuthenticationStatement> result = new LinkedList<>(); for (AuthnStatement s : ofNullable(authnStatements).orElse(emptyList())) { AuthnContext authnContext = s.getAuthnContext(); AuthnContextClassRef authnContextClassRef = authnContext.getAuthnContextClassRef(); String ref = null; if (authnContextClassRef.getAuthnContextClassRef() != null) { ref = authnContextClassRef.getAuthnContextClassRef(); } result.add( new AuthenticationStatement() .setSessionIndex(s.getSessionIndex()) .setAuthInstant(s.getAuthnInstant()) .setSessionNotOnOrAfter(s.getSessionNotOnOrAfter()) .setAuthenticationContext( authnContext != null ? new AuthenticationContext() .setClassReference(AuthenticationContextClassReference.fromUrn(ref)) : null ) ); } return result; }
: ((org.opensaml.saml.saml2.core.Response) response).getAssertions()) { for (final AuthnStatement statement : assertion.getAuthnStatements()) { if (statement.getAuthnContext() != null) { final AuthnContext ac = statement.getAuthnContext(); if (ac.getAuthnContextClassRef() != null) { return ac.getAuthnContextClassRef().getAuthnContextClassRef();