[java-shib-idp2 COMMIT] in /branches/REL_2: doc/RELEASE-NOTES.txt src/main/java/edu/internet2/middleware/shibboleth/i...
noreply at shibboleth.net
noreply at shibboleth.net
Mon Feb 18 10:13:09 EST 2013
Author: scantor
Date: Mon Feb 18 10:13:09 2013
New Revision: 3136
URL: http://svn.shibboleth.net/view/java-shib-idp2?rev=3136&view=rev
Log:
SIDP-562: handle missing session with IdP error handler
Modified:
branches/REL_2/doc/RELEASE-NOTES.txt
branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/ShibbolethSSOProfileHandler.java
branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SSOProfileHandler.java
Modified: branches/REL_2/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-shib-idp2/branches/REL_2/doc/RELEASE-NOTES.txt?rev=3136&r1=3135&r2=3136&view=diff
==============================================================================
--- branches/REL_2/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_2/doc/RELEASE-NOTES.txt Mon Feb 18 10:13:09 2013
@@ -4,6 +4,7 @@
[SIDP-545] - Automatic reloading of relying-party.xml results in errors
[SIDP-557] - aacli.sh Exception (again)
[SIDP-559] - Attribute queries are ignoring input designators
+[SIDP-562] - SSO profile handlers don't check for missing session
[SIDP-563] - IdP-only SAML logout profile handler
[SIDP-564] - Happy Eyeballs support for IdP session cookie address checking
Modified: branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/ShibbolethSSOProfileHandler.java
URL: http://svn.shibboleth.net/view/java-shib-idp2/branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/ShibbolethSSOProfileHandler.java?rev=3136&r1=3135&r2=3136&view=diff
==============================================================================
--- branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/ShibbolethSSOProfileHandler.java (original)
+++ branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/ShibbolethSSOProfileHandler.java Mon Feb 18 10:13:09 2013
@@ -277,6 +277,7 @@
HTTPOutTransport outTransport) throws ProfileException {
ShibbolethSSORequestContext requestContext = buildRequestContext(loginContext, inTransport, outTransport);
+ boolean rethrow = false;
Response samlResponse;
try {
if (loginContext.getAuthenticationFailure() != null) {
@@ -286,7 +287,8 @@
Session session = getUserSession(requestContext.getInboundMessageTransport());
if (session == null) {
- requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER, null, "User failed authentication"));
+ rethrow = true;
+ log.warn("Authentication failure, session missing during completion of profile handler");
throw new ProfileException("Authentication failure, session missing during completion of profile handler");
}
@@ -321,6 +323,10 @@
}
}
} catch (ProfileException e) {
+ if (rethrow) {
+ // Passes the error to the global error handler.
+ throw e;
+ }
samlResponse = buildErrorResponse(requestContext);
}
Modified: branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SSOProfileHandler.java
URL: http://svn.shibboleth.net/view/java-shib-idp2/branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SSOProfileHandler.java?rev=3136&r1=3135&r2=3136&view=diff
==============================================================================
--- branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SSOProfileHandler.java (original)
+++ branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SSOProfileHandler.java Mon Feb 18 10:13:09 2013
@@ -265,6 +265,7 @@
HTTPOutTransport outTransport) throws ProfileException {
SSORequestContext requestContext = buildRequestContext(loginContext, inTransport, outTransport);
+ boolean rethrow = false;
Response samlResponse;
try {
checkSamlVersion(requestContext);
@@ -283,7 +284,8 @@
Session session = getUserSession(requestContext.getInboundMessageTransport());
if (session == null) {
- requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, StatusCode.AUTHN_FAILED_URI, null));
+ rethrow = true;
+ log.warn("Authentication failure, session missing during completion of profile handler");
throw new ProfileException("Authentication failure, session missing during completion of profile handler");
}
@@ -334,6 +336,8 @@
if (requestContext.isUnsolicited()) {
// Just delegate to the IdP's global error handler
log.warn("Unsolicited response generation failed: {}", e.getMessage());
+ throw e;
+ } else if (rethrow) {
throw e;
}
samlResponse = buildErrorResponse(requestContext);
More information about the commits
mailing list