I’m trying to test ‘cookie authorization’ in my ASP.NET Core 8 Web API with Postman.
I have an API Endpoint authtest that I can successfully hit.
When I add the [Authorize]
attribute, I get a “404 Not Found” error.
After logging in with a Postman POST
(with body) request to the login endpoint, I grab the auth cookie:
Auth=CfDJ8Ays_KdJccNKsge90R84fh-gWHlRTEVth-34blhAW4EMO6RnHC . . .
In the Postman request to authtest, I select Cookies, add a localhost Domain, and the auth cookie
Auth=CfDJ8Ays_KdJccNKsge90R84fh-gWHlRTEVth-34blhAW4EMO6RnHC . . .;
Path=/; Secure; HttpOnly;
What am I missing? What AuthType
should I choose in the Authorization tab (I’ve tried ‘No Auth’ and ‘Basic Auth’)?