Example Projects
The examples solution includes web application projects demonstrating SAML SSO, as well as supporting console application projects.
All projects should build cleanly without any errors or warnings.
Tip
As a starting point, it's recommended that the ExampleIdentityProvider and ExampleServiceProvider projects are both run in the Visual Studio debugger to see SAML SSO in action.
Single Sign-On (SSO)
The projects under the SSO folder demonstrate acting either as the SAML Identity Provider (IdP) or SAML Service Provider (SP).
ExampleIdentityProvider + ExampleServiceProvider
- Built using the standard Visual Studio ASP.NET Web Forms template.
- Local authentication uses individual accounts.
- Demonstrates calling the SAML API.
- Run both projects in the Visual Studio debugger to see SAML SSO in action.
MvcIdentityProvider + MvcServiceProvider
- Built using the standard Visual Studio ASP.NET MVC template.
- Local authentication uses individual accounts.
- Demonstrates calling the SAML API.
- Run both projects in the Visual Studio debugger to see SAML SSO in action.
SamlProxy
- Built using the standard Visual Studio ASP.NET MVC template.
- Demonstrates acting as a proxy between IdPs and SPs.
Certificate
CreateSelfSignedCert
- Creates a self-signed X.509 certificate.
- The certificate may be specified as the local certificate in the SAML configuration.
Configuration
CreateConfiguration
- Prompts for information to create a SAML configuration.
ValidateConfig
- Validates that a SAML configuration file is syntactically correct.
Encryption
Decrypt
- Decrypts SAML assertions, attributes and IDs.
Encrypt
- Encrypts SAML assertions, attributes and IDs.
Metadata
CreateMetadata
- Prompts for information to create SAML metadata to share with a partner entity.
ExportMetadata
- Exports SAML configuration as SAML metadata.
ImportMetadata
- Imports SAML metadata into SAML configuration.
MetadataExample
- Demonstrates reading and writing SAML metadata.
ReadMetadata
- Demonstrates reading SAML metadata.
Signature
GenerateSignature
- Generates XML signatures on SAML assertions, messages and metadata.
VerifySignature
- Verifies XML signatures on SAML assertions, messages and metadata.
TestSHA256Signature
- Demonstrates XML signature generation and verification using SHA-1, SHA-256, SHA-384 and SHA-512.
Utility
ParseHttpRedirectUrl
- Parse an SAML HTTP-Redirect URL.
ValidateAgainstSchema
- Validates SAML message, assertion and metadata XML against the SAML XML schemas.
ValidateSAMLMessage
- Validates a SAML message.
SetupSAML
- Sets up local SAML configuration, generates local SAML metadata and imports partner SAML metadata.
- Useful for the initial SAML configuration setup.