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.