1
votes

In our ASP.Net project, I am using 'Kentor.AuthServices' as SAML2 Authentication Service. For testing purpose, I am using 'Kentor.AuthServices.StubIDP'.

Currently we gave an anchor tag in the page with href as: [email protected]("~/AuthServices/SignIn?idp=" + entityId)

This works perfectly fine and once we click the anchor tag, it gets redirected to Identity Provider: http://localhost:17009//SamplePath/AuthServices/SignIn?idp=http://stubidp.kentor.se/Metadata

But what we need to achieve is without using the anchor tag,where we directly enter our site URL address in the browser, it should automatically redirect to Identity Provider.

1
What AuthServices API package are you using? HttpModule? Mvc Controller? Owin? - Anders Abel
Hi Anders. Thanks for the response. We are using HttpModule. In Web config, we added HttpModule config under modules. In the page load, when we do the response.Redirect, it calls the 'OnAuthenticateRequest' method in 'Saml2AuthenticationModule' and then it calls the 'response.Redirect(commandResult.Location.OriginalString)' and it does the SAMLRequest. Is it the proper way to do? - Raj

1 Answers

1
votes

When using the HttpModule, you use the forms authentication setup in the web.config to cause unauthenticated requests to be redirected to the sign in sequence.

<authentication mode="Forms">
    <forms loginUrl="~/AuthServices/SignIn"></forms>
</authentication>