1

It's so strange that this simple solution is not yet implemented or is it that I can't Google it ;p) (I'm trying from last 5 days). My requirements:

  1. Call from Angular App (withCredentials = true) on a URL to see if it is windows user (challenge NTLM). (I may configure this based on what URL user accessing it). If it's a valid Windows user and I find them in DB, I return the Bearer Token.
  2. If Above call returns Unauthorised (401), I show login form to user in my AngularJS (1.6) client. User provides non-windows username and password and when user click Login, from angular service go to another URL (for getting Bearer Token - standard OWIN stuff).

** In any case above, I store Bearer Token in my client for any further API interaction.

  • I'm not using ASP.NET identity but I have my own DAL to verify user from DB.
  • I'm going to have my own custom Authorise (inherited) attribute (which will check for Bearer Token only).
  • I don't want users to enter Windows login on my form and to authenticate them from Active Directory.
  • I Don't want windows users to click on any separate button to login. (They should just login seamless - with prompt from browser asking them windows login)

I've seen hundreds of posts but nowhere I could see exactly what need. Either the mixed authentication needs to be Cookie based or separate MVC implementation. (Lot's of confusion) Already referred:

Can someone please help?

I may have to give up on this by tomorrow evening :-(

NikhilP
  • 53
  • 2
  • 11
  • Hey - were you able to resolve this? Im in the same boat :) – Nick Manojlovic Jun 11 '19 at 17:28
  • Not really, Nick. I had to do a manual / middle way. So, I kept a flag in DB if the auth was Windows. For windows auth, I did it against Active Directory else I used my hashed password match. I wanted the windows challenge, but couldn't get it. On other project I created 2 websites & used redirect if the windows authentication was not successful. – NikhilP Jun 20 '19 at 11:50

0 Answers0