Code Monkey home page Code Monkey logo

Comments (8)

MohammadYounes avatar MohammadYounes commented on June 28, 2024

Hi,

You got into an infinite loop due to disabling anonymous authentication, making the query string ever expanding! which caused the 404.15 error.

Both anonymous/windows authentication modes should be enabled, as the name implies (mixed).

Sorry! but I wasn't able re-produce your issue, if you can provide more details on the environment, configuration or code changes you have made!

from mvc5-mixedauth.

laurentgrangeau avatar laurentgrangeau commented on June 28, 2024

Hi,

When enabling both authentication, the infinite loop disapears.

But when I publish my solution on IIS Server, I'm not able to get my 'Domain\Username'. I only get 'IUSR' (which is the IIS user)
My configuration is 'DefaultAppPool', with Integrated pipeline.

from mvc5-mixedauth.

MohammadYounes avatar MohammadYounes commented on June 28, 2024

IUSR is the default anonymous user account, the only case I found where LogonUserIdentity contained IUSR was when the user has already been forms authenticated. I'm still unable to re-produce your issue.

from mvc5-mixedauth.

laurentgrangeau avatar laurentgrangeau commented on June 28, 2024

Ok, I think I've made some modification to your code that break the MixedAuth...
My need is to automatically login a Windows user if an application setting is set in the web.config.

I change the Login method in the AccountController :
[AllowAnonymous]
public async Task Login(string returnUrl)
{
if (bool.Parse(ConfigurationManager.AppSettings["WindowsAuthentication"]))
{
await WindowsLogin(null, returnUrl);
}

        ViewBag.ReturnUrl = returnUrl;

        return View();
    }

Is it OK ?

from mvc5-mixedauth.

MohammadYounes avatar MohammadYounes commented on June 28, 2024

No, its not OK. The WindowsLogin action should be called only after the right identity exists inside Request.LogonUserIdentity, See the request processing logic inside WindowsLoginHandler.

from mvc5-mixedauth.

laurentgrangeau avatar laurentgrangeau commented on June 28, 2024

Thank you, I'll look at your WindowsLoginHandler implementation.
So how can I identify automatically my Windows user without required them to click on the Windows Login button ?

from mvc5-mixedauth.

MohammadYounes avatar MohammadYounes commented on June 28, 2024

You can configure the solution to start by auto windows login, as described here #6 also Its found under WindowsFirst branch.

from mvc5-mixedauth.

laurentgrangeau avatar laurentgrangeau commented on June 28, 2024

Ok, it seems to work now without my modifications and with Windows first :)
Thank you four your reactiveness

from mvc5-mixedauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.