Skip to content

Commit

Permalink
SES-66 Removed subjectLocality check as the field is just advisory an…
Browse files Browse the repository at this point in the history
…d not supposed to be verified according to spec.
  • Loading branch information
vschafer committed Mar 22, 2011
1 parent 09263eb commit 7810d98
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,15 @@ protected void verifyAssertionConditions(Conditions conditions, SAMLMessageConte
}

/**
* Verifies that authentication statement is valid. Checks the authInstant, sessionNotOnOrAfter and subjectLocality
* fields.
* Verifies that authentication statement is valid. Checks the authInstant and sessionNotOnOrAfter fields.
*
* @param auth statement to check
* @param requestedAuthnContext original requested context can be null for unsolicited messages or when no context was requested
* @param context message context
* @throws AuthenticationException in case the statement is invalid
*/
protected void verifyAuthenticationStatement(AuthnStatement auth, RequestedAuthnContext requestedAuthnContext, SAMLMessageContext context) throws AuthenticationException {

// Validate that user wasn't authenticated too long time ago
if (!isDateTimeSkewValid(getMaxAuthenticationAge(), auth.getAuthnInstant())) {
log.debug("Authentication statement is too old to be used", auth.getAuthnInstant());
Expand All @@ -404,14 +404,6 @@ protected void verifyAuthenticationStatement(AuthnStatement auth, RequestedAuthn
// Verify context
verifyAuthnContext(requestedAuthnContext, auth.getAuthnContext(), context);

if (auth.getSubjectLocality() != null) {
HTTPInTransport httpInTransport = (HTTPInTransport) context.getInboundMessageTransport();
if (auth.getSubjectLocality().getAddress() != null) {
if (!httpInTransport.getPeerAddress().equals(auth.getSubjectLocality().getAddress())) { // TODO Log message
throw new BadCredentialsException("User is accessing the service from invalid address");
}
}
}
}

/**
Expand Down

0 comments on commit 7810d98

Please sign in to comment.