commit
b2f038a174
|
|
@ -48,6 +48,14 @@ public interface Assertion extends Serializable {
|
|||
*/
|
||||
Date getValidUntilDate();
|
||||
|
||||
/**
|
||||
* The date the authentication actually occurred on. If its unable to be determined, it should be set to the current
|
||||
* time.
|
||||
*
|
||||
* @return the authentication date, or the current time if it can't be determined.
|
||||
*/
|
||||
Date getAuthenticationDate();
|
||||
|
||||
/**
|
||||
* The key/value pairs associated with this assertion.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ public final class AssertionImpl implements Assertion {
|
|||
/** The date the assertion is valid until. */
|
||||
private final Date validUntilDate;
|
||||
|
||||
private final Date authenticationDate;
|
||||
|
||||
/** Map of key/value pairs associated with this assertion. I.e. authentication type. */
|
||||
private final Map<String,Object> attributes;
|
||||
|
||||
|
|
@ -77,7 +79,7 @@ public final class AssertionImpl implements Assertion {
|
|||
* @param attributes the key/value pairs for this attribute.
|
||||
*/
|
||||
public AssertionImpl(final AttributePrincipal principal, final Map<String,Object> attributes) {
|
||||
this(principal, new Date(), null, attributes);
|
||||
this(principal, new Date(), null, new Date(), attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -88,16 +90,22 @@ public final class AssertionImpl implements Assertion {
|
|||
* @param validUntilDate when the assertion is valid to.
|
||||
* @param attributes the key/value pairs for this attribute.
|
||||
*/
|
||||
public AssertionImpl(final AttributePrincipal principal, final Date validFromDate, final Date validUntilDate, final Map<String,Object> attributes) {
|
||||
public AssertionImpl(final AttributePrincipal principal, final Date validFromDate, final Date validUntilDate, final Date authenticationDate, final Map<String,Object> attributes) {
|
||||
this.principal = principal;
|
||||
this.validFromDate = validFromDate;
|
||||
this.validUntilDate = validUntilDate;
|
||||
this.attributes = attributes;
|
||||
this.authenticationDate = authenticationDate;
|
||||
|
||||
CommonUtils.assertNotNull(this.principal, "principal cannot be null.");
|
||||
CommonUtils.assertNotNull(this.validFromDate, "validFromDate cannot be null.");
|
||||
CommonUtils.assertNotNull(this.attributes, "attributes cannot be null.");
|
||||
}
|
||||
|
||||
public Date getAuthenticationDate() {
|
||||
return this.authenticationDate;
|
||||
}
|
||||
|
||||
public Date getValidFromDate() {
|
||||
return this.validFromDate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,10 @@ public final class Saml11TicketValidator extends AbstractUrlBasedTicketValidator
|
|||
final Map<String,Object> authenticationAttributes = new HashMap<String,Object>();
|
||||
authenticationAttributes.put("samlAuthenticationStatement::authMethod", authenticationStatement.getAuthenticationMethod());
|
||||
|
||||
return new AssertionImpl(principal, authenticationAttributes);
|
||||
final DateTime notBefore = assertion.getConditions().getNotBefore();
|
||||
final DateTime notOnOrAfter = assertion.getConditions().getNotOnOrAfter();
|
||||
final DateTime authenticationInstant = authenticationStatement.getAuthenticationInstant();
|
||||
return new AssertionImpl(principal, notBefore.toDate(), notOnOrAfter.toDate(), authenticationInstant.toDate(), authenticationAttributes);
|
||||
}
|
||||
} catch (final UnmarshallingException e) {
|
||||
throw new TicketValidationException(e);
|
||||
|
|
|
|||
Loading…
Reference in New Issue