Search code examples
c#asp.net-core-webapiitfoxtec-identity-saml2

Tracing a call to a controller in .NET


I am using ITFoxTec SAML 2.0 library.

From their sample code, I have this controller:

[AllowAnonymous]
[Route("Auth")]
public class AuthController : Controller
{
    const string relayStateReturnUrl = "ReturnUrl";
    private readonly Saml2Configuration config;

    public AuthController(IOptions<Saml2Configuration> options)
    {
        this.config = options.Value;
    }

    [Route("Login")]
    public IActionResult Login(LoginModel loginModel, string returnUrl = null)
    {

The problem is, I have no idea how it's getting called. It gets called right when I start the app and all my other controllers are bypassed. Which is not the behavior I want.

I tried in vain stepping through the code line-by-line in visual studio, but there is nothing in my code that is calling this controller.

Is there anyway to trace how it's getting called?

Thanks!


Solution

  • The login sequence is started and call the login method, if you generally require the user to be authenticated or you decorate your controllers with [Authorize] attribute like in the sample.

    Otherwise, the login method should not be called automatically.