-
-
Notifications
You must be signed in to change notification settings - Fork 764
Authorize in MVC controllers #1148
Comments
Yes -- I can post a sample of this. |
Hi Brock, I think this might be a bug. Thanks again! |
I guess my comment above was making an assumption that I'm not sure of anymore. It sounded like you wanted a registration controller that sat next to IdentityServer in the same host, much like you would for a controller that's the target of a partial login. Is that what you're looking for? |
Actually, I'm using all ASP.NET Identity controllers sat next to IdentityServer in the same host. Sorry for the poor English. =P |
If your MVC code sits next to IdSvr and you want it to be your "login page" then I can post some sample code (when I get some time). Otherwise you need to move your MVC code out of IdSvr and use normal OIDC to authenticate. |
The issue is that our login page requires a protocol to use it. You'll need something like this:
|
Or if you don't need access to the idsrv bits in your part of the application (outside idsrv), you can use the Map method of Katana like in the samples, and use the OIDC middleware for the other path (your client) to connect to idsrv like you would with any other client.
|
John, thanks! Yes, I need the "bits of IdSrv" in my part of application and I was trying to use the OIDC middleware. That was my fail. Brock, the snipet is exactly what I was looking for! Cheers from Brazil! o/ |
Spent several hours on this and finally the additional attribute above by @brockallen made it work (needed to add |
Hi everyone,
In the CustomUserService sample e.g., it's possible to protect a MVC controller with katana openId middleware pointing to Identity Server itself?
I've tried, but the protected controllers doesn't redirect to login. Instead, it responds 401 - Unauthorized.
Thanks!
The text was updated successfully, but these errors were encountered: