I have a freshly installed Laravel 11 with api-platforms/laravel. The platform has authentication configured via apiToken. After authorization, when trying to make a request via platform, authorization header is not added to it, as a result I get the 401 status. If I send a request from a third-party resource with a correctly added header, authentication is successful, the request is executed correctly.
config/api-platform.php fragment:
'swagger_ui' => [
'enabled' => true,
'apiKeys' => [
'api' => [
'type' => 'apiKey',
'name' => 'Authorization',
'in' => 'header'
]
],
]
I have a freshly installed Laravel 11 with api-platforms/laravel. The platform has authentication configured via apiToken. After authorization, when trying to make a request via platform, authorization header is not added to it, as a result I get the 401 status. If I send a request from a third-party resource with a correctly added header, authentication is successful, the request is executed correctly.
config/api-platform.php fragment:
'swagger_ui' => [
'enabled' => true,
'apiKeys' => [
'api' => [
'type' => 'apiKey',
'name' => 'Authorization',
'in' => 'header'
]
],
]
Share
Improve this question
edited Feb 3 at 22:15
undefined
2,47127 silver badges41 bronze badges
asked Jan 31 at 10:01
Максим ШептухаМаксим Шептуха
11 bronze badge
1 Answer
Reset to default 0Ensure CORS is not blocking your requests. Then, clear config & cache.
php artisan config:clear
php artisan cache:clear
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745270330a4619706.html
评论列表(0条)