-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07d4a9a
commit af19aa6
Showing
5 changed files
with
84 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Sustainsys.Saml2.Saml; | ||
|
||
/// <summary> | ||
/// A Saml assertion | ||
/// </summary> | ||
public class SamlAssertion | ||
{ | ||
/// <summary> | ||
/// Issuer of the assertion. | ||
/// </summary> | ||
public NameId Issuer { get; set; } = default!; | ||
} |
32 changes: 32 additions & 0 deletions
32
src/Sustainsys.Saml2/Validation/ISamlAssertionValidator.cs
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,32 @@ | ||
using Sustainsys.Saml2.Saml; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Sustainsys.Saml2.Validation; | ||
|
||
/// <summary> | ||
/// Validates an asseriton | ||
/// </summary> | ||
public interface ISamlAssertionValidator | ||
{ | ||
/// <summary> | ||
/// Validate a Saml assertion | ||
/// </summary> | ||
/// <param name="assertion"></param> | ||
/// <param name="parameters"></param> | ||
void Validate(SamlAssertion assertion, SamlAssertionValidationParameters parameters); | ||
} | ||
|
||
/// <summary> | ||
/// DTO carrying parameters for Saml assertion validation | ||
/// </summary> | ||
public class SamlAssertionValidationParameters | ||
{ | ||
/// <summary> | ||
/// Valid issuer of the response and assertions | ||
/// </summary> | ||
public NameId? ValidIssuer { get; set; } | ||
} |
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,22 @@ | ||
using Sustainsys.Saml2.Saml; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Sustainsys.Saml2.Validation; | ||
|
||
/// <summary> | ||
/// Saml Assertion validator | ||
/// </summary> | ||
public class SamlAssertionValidator : ISamlAssertionValidator | ||
{ | ||
/// <inheritdoc/> | ||
public void Validate( | ||
SamlAssertion assertion, | ||
SamlAssertionValidationParameters parameters) | ||
{ | ||
// TODO: Remember to validate issuer. | ||
} | ||
} |
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