Skip to content

This is the source code that can be used for validating the incoming SAML

Notifications You must be signed in to change notification settings

acheriya/SamlAuth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SamlAuth

This is the source code for the libray that can be used for validating the incoming SAML, Supports OKTA, ADFS, ACS issued token validation SAML auth provider developed using C#

Integrating with OKTA in ASP.NET MVC

    [HttpPost]
    public ActionResult Saml()
    {
        string saml = Request.Form["SamlResponse"];

        var samlConfig = new SamlConfig
        {
            Name = "OKTA",
            CertificateThumbprint = "444*******************454",
            Audience = "https://dev-****-admin.okta.com",
            ValidIssuers = new List<string> { "http://www.okta.com/e*****456" }
        };

        SamlAuthProvider authProvider = new SamlAuthProvider(samlConfig);

        if (authProvider.Validate(saml))
        {
            //Login using your authentication provider
            //authProvider.Name give the identity name associated with Saml
         
            return RedirectToAction("Index", "Home");
        }


        return Unauthorized();
    }

About

This is the source code that can be used for validating the incoming SAML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages