opnarius / SamlIdp.Owin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build status SamlIdp.Owin

An Owin middleware to create a SAML IdP, based on the Kentor.AuthServices

Installation

Install-Package SamlIdp.Owin

Endpoints

  • /metadata - SAML metadata
  • /logout - SSO logout
  • /authorize - SAML authentication requests
  • /artifact - SAML artifact resolution

Example

app.Map("/saml", saml =>
{
    saml.UseCookieAuthentication(new CookieAuthenticationOptions
    {
        AuthenticationType = "Cookies"
    });

    saml.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
    {
        Authority = "https://www.example.com",
        ClientId = "example",
        ClientSecret = "example123",
        RedirectUri = "http://www.example.com/saml",
        ResponseType = "code id_token token",
        Scope = "openid",
        SignInAsAuthenticationType = "Cookies"
    });

    var options = new SamlIdpOptions
    {
        AuthenticationType = OpenIdConnectAuthenticationDefaults.AuthenticationType,
        SigningCertificate = Certificate.Get()
    };
    saml.UseSamlIdp(options);
});

About

License:GNU Lesser General Public License v3.0


Languages

Language:C# 100.0%