I have been following these docs: https://docs.servicestack.net/authentication-identityserver
What I have is a simple Identity4 server (separate project) running on my local machine. It generates tokens and everything seems to work according to spec. Now when I add the [Authenticate] attribute to my requests I get the expected “401 Unauthorized”.
I am just trying to protect a service stack API so I just added the bottom part from the docs under the headline “API”.
So add the authentication “Bearer” to the services, add the Plugins “NetCoreIdentityAuthProvider” and the [Authenticate] attribute. Now I’m starting a request in Insomnia pointing to the previously working resource; add OAuth verification and I only get Unauthorized errors.
I have already checked the request (with the prerequestfilter) to see that the “Authorization” header is in the request with the value: “Bearer andalongtokenhere”.
Still unauthorized, I’m also not getting any further debug info. Can someone please help me get this working? Or help me get more info on this?
I feel like I’m missing something but I can’t figure it out.
Ps. I tried the default project: https://github.com/NetCoreTemplates/mvcidentityserver just to see if it works but after download it instantly reports some errors (Startup is not extended from ModularStartup etc) so it seems that project is broken by default.