Atif Husain

Atif Husain

  • NA
  • 9
  • 2.1k

VS2022 React client ASP with Identity - Role authorization not workin

Sep 16 2022 2:32 PM

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??


Answers (1)