= (AuthenticationStatement)CommonUtil.buildXMLObject(AuthenticationStatement.DEFAULT_ELEMENT_NAME); authenticationStatement.setSubject(subject); authenticationStatement.setAuthenticationMethod(authenticationMethod); authenticationStatement.setAuthenticationInstant(authenticationInstant);
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException { AuthenticationStatement authenticationStatement = (AuthenticationStatement) samlElement; if (authenticationStatement.getAuthenticationMethod() != null) { domElement.setAttributeNS(null, AuthenticationStatement.AUTHENTICATIONMETHOD_ATTRIB_NAME, authenticationStatement.getAuthenticationMethod()); } if (authenticationStatement.getAuthenticationInstant() != null) { String value = Configuration.getSAMLDateFormatter().print( authenticationStatement.getAuthenticationInstant()); domElement.setAttributeNS(null, AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_NAME, value); } } }
/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { AuthenticationStatement authenticationStatement = (AuthenticationStatement) parentSAMLObject; if (childSAMLObject instanceof SubjectLocality) { authenticationStatement.setSubjectLocality((SubjectLocality) childSAMLObject); } else if (childSAMLObject instanceof AuthorityBinding) { authenticationStatement.getAuthorityBindings().add((AuthorityBinding) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }
Subject authSubject = SAML1ComponentBuilder.createSaml1v1Subject(statementBean.getSubject()); authenticationStatement.setSubject(authSubject); authenticationStatement.setAuthenticationInstant( statementBean.getAuthenticationInstant() ); } else { authenticationStatement.setAuthenticationInstant(new DateTime()); authenticationStatement.setAuthenticationMethod( transformAuthenticationMethod(statementBean.getAuthenticationMethod()) ); subjectLocality.setIPAddress(subjectLocalityBean.getIpAddress()); authenticationStatement.setSubjectLocality(subjectLocality);
/** {@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); } } }
if (authenticationStatements != null && authenticationStatements.size() > 0) { AuthenticationStatement authenticationStatement = authenticationStatements.get(0); subject = authenticationStatement.getSubject(); if (subject != null) { String resourceOwnerUserName = subject.getNameIdentifier().getNameIdentifier();
DateTime authnInstant = authnStatement.getAuthenticationInstant(); String subjectLocalityAddress = null; if (authnStatement.getSubjectLocality() != null && authnStatement.getSubjectLocality().getIPAddress() != null) { subjectLocalityAddress = authnStatement.getSubjectLocality().getIPAddress();
/** * Validates that the authentication statement has an authentication instant. * * @param authenticationStatement the statement to validate * * @throws ValidationException thrown if the statement does not have an authentication instant */ protected void validateAuthenticationInstant(AuthenticationStatement authenticationStatement) throws ValidationException { if (authenticationStatement.getAuthenticationInstant() == null) { throw new ValidationException("No authenticationInstant present"); } } }
Subject authSubject = SAML1ComponentBuilder.createSaml1v1Subject(statementBean.getSubject()); authenticationStatement.setSubject(authSubject); authenticationStatement.setAuthenticationInstant( statementBean.getAuthenticationInstant() ); } else { authenticationStatement.setAuthenticationInstant(new DateTime()); authenticationStatement.setAuthenticationMethod( transformAuthenticationMethod(statementBean.getAuthenticationMethod()) ); subjectLocality.setIPAddress(subjectLocalityBean.getIpAddress()); authenticationStatement.setSubjectLocality(subjectLocality);
if (authenticationStatements != null && authenticationStatements.size() > 0) { AuthenticationStatement authenticationStatement = authenticationStatements.get(0); subject = authenticationStatement.getSubject(); if (subject != null) { String resourceOwnerUserName = subject.getNameIdentifier().getNameIdentifier();
DateTime authnInstant = authnStatement.getAuthenticationInstant(); String subjectLocalityAddress = null; if (authnStatement.getSubjectLocality() != null && authnStatement.getSubjectLocality().getIPAddress() != null) { subjectLocalityAddress = authnStatement.getSubjectLocality().getIPAddress();
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; }
org.opensaml.saml1.core.AuthenticationStatement authStmt = (org.opensaml.saml1.core.AuthenticationStatement) stmt; samlSubject = authStmt.getSubject(); } else { org.opensaml.saml1.core.AuthorizationDecisionStatement authzStmt =
org.opensaml.saml1.core.AuthenticationStatement authStmt = (org.opensaml.saml1.core.AuthenticationStatement) stmt; samlSubject = authStmt.getSubject(); } else { org.opensaml.saml1.core.AuthorizationDecisionStatement authzStmt =
org.opensaml.saml1.core.AuthenticationStatement authStmt = (org.opensaml.saml1.core.AuthenticationStatement) stmt; samlSubject = authStmt.getSubject(); } else { org.opensaml.saml1.core.AuthorizationDecisionStatement authzStmt =
org.opensaml.saml1.core.AuthenticationStatement authStmt = (org.opensaml.saml1.core.AuthenticationStatement) stmt; samlSubject = authStmt.getSubject(); } else { org.opensaml.saml1.core.AuthorizationDecisionStatement authzStmt =