Being a bit new to ASP and React, I am using a VS generated React JS app with Identity Login;
However when I use react fetch to run the API to Get (bearer token is valid) with below Authorize
[Authorize(Roles = SuperAdmin)]
The fetch call returns FORBIDDEN and on server side the below error "Uncaught SyntaxError SyntaxError: Unexpected end of JSON
However changing Authorize attribute to [Authorize] works fine!!!
I want to use role based authorization on controller.... what am I missing??
Rijwan AnsariPosted Sep 17, 2022, 5:53 AM
Check this article https://jasonwatmore.com/post/2022/02/18/net-6-role-based-authorization-tutorial-with-example-api