-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #178 from ITfoxtec/development
Development
- Loading branch information
Showing
27 changed files
with
297 additions
and
26 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
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
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,62 @@ | ||
using System.Collections.Generic; | ||
using System.Xml.Linq; | ||
|
||
namespace ITfoxtec.Identity.Saml2.Schemas | ||
{ | ||
/// <summary> | ||
/// The IDPEntry element specifies a single identity provider trusted by the requester to authenticate the | ||
/// presenter.Its IDPEntryType complex type defines the following attributes: | ||
/// </summary> | ||
public class IDPEntry | ||
{ | ||
public const string elementName = Saml2Constants.Message.IDPEntry; | ||
|
||
/// <summary> | ||
/// [Required] | ||
/// The unique identifier of the identity provider.See Section 8.3.6 for a description of such identifiers. | ||
/// </summary> | ||
public string ProviderID { get; set; } | ||
|
||
/// <summary> | ||
/// [Optional] | ||
/// A human-readable name for the identity provider. | ||
/// </summary> | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// [Optional] | ||
/// A URI reference representing the location of a profile-specific endpoint supporting the authentication | ||
/// request protocol.The binding to be used must be understood from the profile of use. | ||
/// </summary> | ||
public string Loc { get; set; } | ||
|
||
public XElement ToXElement() | ||
{ | ||
var envelope = new XElement(Saml2Constants.AssertionNamespaceX + elementName); | ||
|
||
envelope.Add(GetXContent()); | ||
|
||
return envelope; | ||
} | ||
|
||
protected virtual IEnumerable<XObject> GetXContent() | ||
{ | ||
yield return new XAttribute(Saml2Constants.AssertionNamespaceNameX, Saml2Constants.AssertionNamespaceX); | ||
|
||
if (ProviderID != null) | ||
{ | ||
yield return new XAttribute(Saml2Constants.Message.ProviderID, ProviderID); | ||
} | ||
|
||
if (Name != null) | ||
{ | ||
yield return new XAttribute(Saml2Constants.Message.Name, Name); | ||
} | ||
|
||
if (Loc != null) | ||
{ | ||
yield return new XAttribute(Saml2Constants.Message.Loc, Loc); | ||
} | ||
} | ||
} | ||
} |
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,53 @@ | ||
using System.Collections.Generic; | ||
using System.Xml.Linq; | ||
|
||
namespace ITfoxtec.Identity.Saml2.Schemas | ||
{ | ||
/// <summary> | ||
/// The element specifies the identity providers trusted by the requester to authenticate the presenter. | ||
/// </summary> | ||
public class IDPList | ||
{ | ||
public const string elementName = Saml2Constants.Message.IDPList; | ||
|
||
/// <summary> | ||
/// [One or More] | ||
/// Information about a single identity provider. | ||
/// </summary> | ||
public IEnumerable<IDPEntry> IDPEntry { get; set; } | ||
|
||
/// <summary> | ||
/// [Optional] | ||
/// If the IDPList is not complete, using this element specifies a URI reference that can be used to | ||
/// retrieve the complete list. | ||
/// </summary> | ||
public string GetComplete { get; set; } | ||
|
||
public XElement ToXElement() | ||
{ | ||
var envelope = new XElement(Saml2Constants.AssertionNamespaceX + elementName); | ||
|
||
envelope.Add(GetXContent()); | ||
|
||
return envelope; | ||
} | ||
|
||
protected virtual IEnumerable<XObject> GetXContent() | ||
{ | ||
yield return new XAttribute(Saml2Constants.AssertionNamespaceNameX, Saml2Constants.AssertionNamespaceX); | ||
|
||
if (GetComplete != null) | ||
{ | ||
yield return new XAttribute(Saml2Constants.Message.GetComplete, GetComplete); | ||
} | ||
|
||
if (IDPEntry != null) | ||
{ | ||
foreach (var entry in IDPEntry) | ||
{ | ||
yield return entry.ToXElement(); | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.