/** {@inheritDoc} */ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException { AuthenticationStatement authenticationStatement = (AuthenticationStatement) samlObject; if (AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_NAME.equals(attribute.getLocalName()) && !DatatypeHelper.isEmpty(attribute.getValue())) { DateTime value = new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC()); authenticationStatement.setAuthenticationInstant(value); } else if (AuthenticationStatement.AUTHENTICATIONMETHOD_ATTRIB_NAME.equals(attribute.getLocalName())) { authenticationStatement.setAuthenticationMethod(attribute.getValue()); } else { super.processAttribute(samlObject, attribute); } } }
private AuthenticationStatement newAuthenticationStatement(final Authentication authentication) { final String authenticationMethod = (String) authentication.getAttributes().get( SamlAuthenticationMetaDataPopulator.ATTRIBUTE_AUTHENTICATION_METHOD); final AuthenticationStatement authnStatement = newSamlObject(AuthenticationStatement.class); authnStatement.setAuthenticationInstant(new DateTime(authentication.getAuthenticatedDate())); authnStatement.setAuthenticationMethod(authenticationMethod != null ? authenticationMethod : SamlAuthenticationMetaDataPopulator.AUTHN_METHOD_UNSPECIFIED); authnStatement.setSubject(newSubject(authentication.getPrincipal().getId())); return authnStatement; }
authenticationStatement.setAuthenticationMethod(authenticationMethod); authenticationStatement.setAuthenticationInstant(authenticationInstant);
authenticationStatement.setAuthenticationMethod( transformAuthenticationMethod(statementBean.getAuthenticationMethod()) );
authenticationStatement.setAuthenticationMethod( transformAuthenticationMethod(statementBean.getAuthenticationMethod()) );