Skip to content

Commit

Permalink
Ensure AuthnRequest destination URL is not incorrectly formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersAbel committed Sep 26, 2018
1 parent 116a52f commit 6388f9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sustainsys.Saml2/SAML2P/Saml2RequestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected IEnumerable<XObject> ToXNodes()

if (DestinationUrl != null)
{
yield return new XAttribute("Destination", DestinationUrl);
yield return new XAttribute("Destination", DestinationUrl.OriginalString);
}

if (Issuer != null && !string.IsNullOrEmpty(Issuer.Id))
Expand Down
3 changes: 2 additions & 1 deletion Tests/Tests.Shared/IdentityProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public void Cleanup()
[TestMethod]
public void IdentityProvider_CreateAuthenticateRequest_DestinationInXml()
{
string idpUri = "http://idp.example.com/";
// %41 is A, which doesn't need to be encoded. Ensure it is kept in original format.
string idpUri = "http://idp.example.com/x=%41";

var subject = new IdentityProvider(
new EntityId(idpUri),
Expand Down

0 comments on commit 6388f9e

Please sign in to comment.