I have an existing WEB API 2 project with JWT authentication. how I merge my WEB API application so it's similar like Administration project. the route will be something like localhost/api/[myApiRoute] I know there's an alternative way using plugin, but I got a dead end implementing JWT and my customization handler.
I have an existing WEB API 2 project with JWT authentication. how I merge my WEB API application so it's similar like Administration project. the route will be something like localhost/api/[myApiRoute] I know there's an alternative way using plugin, but I got a dead end implementing JWT and my customization handler.
I appreciate your help.
I think you can add Nop.WebApi project like Nop.Web. I have created a web api project customize Nop.Web. From my experience I suggest you add a new project in the nop solution like nop.web. And merge your existing code there.
now you can use [System.Web.Http.Authorize] attribute to authorize your API using OWIN Authentication. I also add new folder called API and put all API files there (Controller, Models, Provider, Handlers, etc.) so it would easy to maintain.
now you can use [System.Web.Http.Authorize] attribute to authorize your API using OWIN Authentication. I also add new folder called API and put all API files there (Controller, Models, Provider, Handlers, etc.) so it would easy to maintain.
I'm curious. How did you get your API calls to authorize with JWT?
I've added the required nuget packages according to http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/ but when I call the secured API controller I keep getting the HTML for the login view as response instead of a "normal" 401.
I can call things that are not secured with the [Authorize] attribute, so the API it self is working. I just can't seem to "skip" forms authentication in favor of token auth.
Any clues? Any information or nudges in the right direction will be much appreciated.