What are the steps required to reproduce the bug?
- Fresh D 8.x installation
- Enable rest module
- Create some nodes
- Add rest export display to the Frontpage /node view with path /node
- Request /node with Authorization admin:password and Accept json
curl --user admin:admin --header 'Accept: application/hal+json' --request GET http://drupal.d8/node - Ends in 403
What behavior were you expecting?
Getting the nodes in json format
What happened instead?
Ends in 403
Comments
Comment #1
dawehnerHint: Always provide views exports, its the only human readable format to talk about views, IMHO
I guess you talk about basic auth? Have you configured basic auth in your view?
Comment #2
chr.fritschYes i talk about basic auth. What do you mean with configure? Have i overlooked some configuration possibilities?
Comment #3
dawehner#2228141: Add authentication support to REST views was supposed to add that, sorry.
Comment #4
clemens.tolboomCrap ... spent too much time debugging instead of searching to find this issue.
I guess this got broken by #2286971: Remove dependency of current_user on request and authentication manager or #2432585: Improve authentication manager service construction to support custom global service providers
Requesting views with basic auth falls back to the globalProviders which has none for basic_auth.
core/lib/Drupal/Core/Authentication/AuthenticationManager.php:217
Hacking core/lib/Drupal/Core/Authentication/AuthenticationManager.php:66
gives a decent response :)
Comment #5
clemens.tolboomAs #2228141: Add authentication support to REST views IS what we need I try to reroll that issue.
Comment #6
clemens.tolboomI've rerolled #2228141: Add authentication support to REST views and manually tested it. Now my curl command works again.
I close this as a duplicate (closest state I guess) of mentioned issue as we have a fix.