[java-identity-provider COMMIT] in /trunk/idp-saml-impl/src: main/java/net/shibboleth/idp/saml/saml1/profile/impl/IdP...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Dec 19 21:38:58 EST 2014
Author: scantor
Date: Fri Dec 19 21:38:57 2014
New Revision: 7206
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7206&view=rev
Log:
IDP-549 - Legacy Shibboleth SSO requests should fail if no target param is supplied
Modified:
trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoder.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoder.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoder.java?rev=7206&r1=7205&r2=7206&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoder.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoder.java Fri Dec 19 21:38:57 2014
@@ -76,9 +76,15 @@
* Populate the context which carries information specific to this binding.
*
* @param messageContext the current message context
+ *
+ * @throws MessageDecodingException if the message content is invalid
*/
- protected void populateBindingContext(@Nonnull final MessageContext<IdPInitiatedSSORequest> messageContext) {
+ protected void populateBindingContext(@Nonnull final MessageContext<IdPInitiatedSSORequest> messageContext)
+ throws MessageDecodingException {
final String relayState = messageContext.getMessage().getRelayState();
+ if (relayState == null) {
+ throw new MessageDecodingException("Legacy Shibboleth authentication requests require a target parameter");
+ }
log.debug("Decoded SAML relay state: {}", relayState);
SAMLBindingContext bindingContext = messageContext.getSubcontext(SAMLBindingContext.class, true);
Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java?rev=7206&r1=7205&r2=7206&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java Fri Dec 19 21:38:57 2014
@@ -103,4 +103,12 @@
Assert.assertEquals(msgInfoContext.getMessageId(), messageID, "Incorrect decoded message ID value in message info context");
}
-}
+ @Test(expectedExceptions=MessageDecodingException.class)
+ public void testMissingTarget() throws MessageDecodingException {
+ request.addParameter(BaseIdPInitiatedSSORequestMessageDecoder.PROVIDER_ID_PARAM, entityId);
+ request.addParameter(BaseIdPInitiatedSSORequestMessageDecoder.SHIRE_PARAM, acsUrl);
+ request.addParameter(BaseIdPInitiatedSSORequestMessageDecoder.TIME_PARAM, time.toString());
+
+ decoder.decode();
+ }
+}
More information about the commits
mailing list