0

We currently have OWIN setup to authenticate our Web APIs that are at the root site. These are used by normal users. We are now in need of the ability to call similar functionality, but as a admin. We thought about creating a Area such as "Admin" and have APIs within it. But we need it to authenticate using a different OWIN UserManager, as our admin accounts are stored in a separate location than normal users.

Is it possible to use a different OWIN UserManager for a sub folder or "Area" of a site?

John C
  • 1,761
  • 2
  • 20
  • 30

1 Answers1

0

Yes. The easiest way to achieve this is to have the admin area as a separate site. Alter project. Jsonb and you'll be sorted

Adrian Booth
  • 154
  • 1
  • 6
  • Well that is not exactly what we are going for, that is why I said a area. Also we don't need yet another project in our solution. – John C Jun 22 '14 at 17:31
  • You're issues will arise because the project.json should really be application. Json it is for the whole site. There are some things the app only has one of such as membership providers etc. Sorry I couldn't be more help but I would have another app under a virtual path so it seemed seamless, at least from the URL perspective. I haven't played enough with owing / vnext to say I've tried. If you get an elegant solution it would be an excellent thing to post though. Good luck dude. – Adrian Booth Jun 22 '14 at 17:37
  • What do you mean when you say project.json? It's relatively easy to configure a different membership providers for a site. You can set them in a Web.config per folder. Plus you can add multiple providers and recall them by name. – John C Jun 22 '14 at 17:42
  • With you saying you're using owin that's what .net vnext uses. The web. Config has been replaced with project. Json – Adrian Booth Jun 22 '14 at 17:58
  • Never said anything about vnext... and owin is not in Web.config. – John C Jun 22 '14 at 18:10
  • I think you were thinking of config.json as the replacement for web.config, not project.json. But again, OWIN is configured in the startup class/code, not in Web.config – John C Jun 22 '14 at 21:31