forked from Sustainsys/Saml2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New notification called for signin command
- Loading branch information
1 parent
97eaf4c
commit 3a97c86
Showing
21 changed files
with
226 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Xml.Linq; | ||
|
||
namespace Sustainsys.Saml2.Internal | ||
{ | ||
static class XDocumentExtensions | ||
{ | ||
public static string ToStringWithXmlDeclaration(this XDocument xDocument) | ||
{ | ||
if (xDocument.Declaration != null) | ||
{ | ||
return xDocument.Declaration?.ToString() + "\r\n" + xDocument.ToString(); | ||
} | ||
|
||
return xDocument.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Sustainsys.Saml2.Internal; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Xml.Linq; | ||
|
||
namespace Sustainsys.Saml2.Saml2P | ||
{ | ||
static class Saml2MessageExtensions | ||
{ | ||
/// <summary> | ||
/// Serializes the message into wellformed XML. | ||
/// </summary> | ||
/// <param name="message">Saml2 message to transform to XML</param> | ||
/// <param name="xmlCreatedNotification">Notification allowing modification of XML tree before serialization.</param> | ||
/// <returns>string containing the Xml data.</returns> | ||
public static string ToXml<TMessage>(this TMessage message, Action<TMessage, XDocument> xmlCreatedNotification) | ||
where TMessage : ISaml2Message | ||
{ | ||
var xDocument = new XDocument(message.ToXElement()); | ||
|
||
xmlCreatedNotification(message, xDocument); | ||
|
||
return xDocument.ToStringWithXmlDeclaration(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.