Return a 401 message with an JSON encoded body, if no authentication header is passed for an API request.

Also for browser requests, a flash message is shown in that case, prompting the user to authenticate.

This follows a suggestion from issue #494
This commit is contained in:
Jan Böhmer 2024-01-25 23:35:15 +01:00
parent 631c364179
commit f0519ae0b3
3 changed files with 1512 additions and 1430 deletions

View file

@ -19,7 +19,7 @@ security:
provider: app_user_provider
lazy: true
user_checker: App\Security\UserChecker
entry_point: form_login
entry_point: App\Security\AuthenticationEntryPoint
# Enable user impersonation
switch_user: { role: CAN_SWITCH_USER }