1

So, I went through the answer/comment on this post and made an exactly similar project in ASP.NET core. But my Problem is that I have seperate resource server project under the same src folder. and although the [Authorize("Bearer")] attribute works for the controller methods in the authorize server project it does not work in the resource server project.

The code would be the same as mentioned on the link above but if required, I could post.

Community
  • 1
  • 1
Melroy Fernandes
  • 371
  • 1
  • 5
  • 16

1 Answers1

3

If anyone would like to know how I solved this issue can read further.

The two projects would generate different private keys, so the Resource server would reject the token/public key generated by the Authorize Server.

To solve this issue I would basically store the private key generated by the Auth Server in a common place(file) and access that key in the Resource Server. So the same key is accessed by both the servers for authorization.

Melroy Fernandes
  • 371
  • 1
  • 5
  • 16