Skip to content
Snippets Groups Projects
Unverified Commit ea800962 authored by Sergii Bondarenko's avatar Sergii Bondarenko Committed by Mateu Aguiló Bosch
Browse files

Issue #2934486 by BR0kEN, justinlevi, e0ipso, cilefen: $_Files object is lost during authentication

parent 52a8e4ef
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ class SimpleOauthAuthenticationProvider implements AuthenticationProviderInterfa
public function authenticate(Request $request) {
// Update the request with the OAuth information.
try {
$request = $this->resourceServer->validateAuthenticatedRequest($request);
$auth_request = $this->resourceServer->validateAuthenticatedRequest($request);
}
catch (OAuthServerException $exception) {
// Procedural code here is hard to avoid.
......@@ -81,7 +81,7 @@ class SimpleOauthAuthenticationProvider implements AuthenticationProviderInterfa
}
$tokens = $this->entityTypeManager->getStorage('oauth2_token')->loadByProperties([
'value' => $request->get('oauth_access_token_id'),
'value' => $auth_request->get('oauth_access_token_id'),
]);
$token = reset($tokens);
......@@ -99,6 +99,9 @@ class SimpleOauthAuthenticationProvider implements AuthenticationProviderInterfa
);
}
// Inherit uploaded files for the current request.
/* @link https://www.drupal.org/project/drupal/issues/2934486 */
$request->files->add($auth_request->files->all());
// Set consumer ID header on successful authentication, so negotiators
// will trigger correctly.
$request->headers->set('X-Consumer-ID', $account->getConsumer()->uuid());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment