0
votes

Hello I try to SMAL integration with Sustainsys.Saml2. I develop an web application with ASP.NET (not MVC or Core). This web application is service provider for SAML.

I changed the my config as in the example. Now I need to start authenticate in my login page and redirect to identity provider's page. In this page they say for ASP.NET web forms "In many cases it should just be configured in the web.config file and work without any code written in the application at all". But authentication not start automatically.

I run MVC example and see this line in Index.cshtml

<a href="@Url.Content("~/Saml2/SignIn")">Sign in</a> - default IDP
@foreach (var idp in Sustainsys.Saml2.Configuration.SustainsysSaml2Section.Current.IdentityProviders)
{
    var entityId = idp.EntityId;
    var destinationUrl = idp.SignOnUrl;
    <br />
    <a href="@Url.Content("~/Saml2/SignIn?idp=" + HttpUtility.UrlEncode(entityId))">Sign in</a>@: - @entityId - @destinationUrl
}

If I click this link it redirect to identity provider's page. How can integrate this for ASP.Net and start authentication for ASP.Net?

1

1 Answers

1
votes

You should use the HttpModule with Web forms. To start authentication redirect the user to /Saml2/SignIn.

Or protect the entire application with automatic redirection by settings in web.config:

  • Authentication mode Forms with a login url of /Saml2/SignIn
  • Set Authorization rules in web.config to disallow anonymous access to all pages.