SAML
Appearance
This page should be attached to a book. This is not a stub or a one-page book. |
C#
[edit | edit source]
/// <summary>
/// Decodes a SAML string into plain text
/// SAML: XML open-standard for exchanging authorisation/authentication data btw. identity & service providers
/// More info cf. http://en.wikipedia.org/wiki/Security_Assertion_Markup_Language
/// SAML address the SSO problem (cf. http://en.wikipedia.org/wiki/Single_sign-on)
/// </summary>
/// <param name="encodedSAML">Encoded SAML string</param>
/// <returns>Plaintext SAML</returns>
private static string DecodeSAML(string encodedSAML)
{
if (encodedSAML.Contains("%"))
{
encodedSAML = HttpUtility.UrlDecode(encodedSAML);
}
byte[] decodedSAML = Convert.FromBase64String (encodedSAML);
return Encoding.UTF8.GetString(decodedSAML);
}