-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
SecurityhasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.
Description
In the example for a custom authenticator, the API key is passed to the UserBadge
as the user identifier. However, it cannot be assumed that the API key is the same as the user identifier. Doesn't the user identifier have to be determined from the API token and then passed to the UserBadge
?
symfony-docs/security/authenticator_manager.rst
Lines 318 to 328 in 15084a8
public function authenticate(Request $request): Passport | |
{ | |
$apiToken = $request->headers->get('X-AUTH-TOKEN'); | |
if (null === $apiToken) { | |
// The token header was empty, authentication fails with HTTP Status | |
// Code 401 "Unauthorized" | |
throw new CustomUserMessageAuthenticationException('No API token provided'); | |
} | |
return new SelfValidatingPassport(new UserBadge($apiToken)); | |
} |
Metadata
Metadata
Assignees
Labels
SecurityhasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.