Disable authorization for preflight request CORS issue

215 Views Asked by At

aspnet core web api is secured by windows authentication. IIS hosted Client is angular. Browser is not sending user credentials for the preflight request, hence CORS issue is happening.

I have implemented customAuthorization attribute to check for valid user roles. For preflight request this Authorize attribute fails and logs a message- User is not a member of the group.

Is there a way to disable authorization for preflight request.

  1. Is there a way to get HttpContextAccessor object in the CustomAuthorization attribute class. DI through constructor is not possible to the attribute class.

Confugured CORS allowAnymethod, credentials, headers,anyorigin, even then API request is failing with cors issue.

0

There are 0 best solutions below