We have an application in production built in mvc5 with cookie authentication. We added a component to this project that uses web api controller. When a logged in user tries to access the part of the system that uses web api the controller is asking them to sign in again. Is there a way to make web api use the same cookie authentication as the mvc controllers?
You cannot authenticate WebApi by the use of cookies. If you want to a secured WebApi you should implement your access token generation.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.