Profile picture pulled from keycloak is invalid

Created on 31 May 2022, over 2 years ago
Updated 14 March 2023, almost 2 years ago

Profile picture pulled from keycloak is invalid

I am not sure what is the problem here... I am trying to request an img from keycloak and when the request is complete i get the following error:

Warning: file_get_contents(img.jpg): failed to open stream: No such file or directory in Drupal\openid_connect\OpenIDConnect->saveUserinfo() (line 632 of modules/openid_connect/src/OpenIDConnect.php).
Drupal\openid_connect\OpenIDConnect->saveUserinfo(Object, Array) (Line: 315)
Drupal\openid_connect\OpenIDConnect->completeAuthorization(Object, Array, Array) (Line: 192)
Drupal\openid_connect\Controller\OpenIDConnectRedirectController->authenticate('keycloak')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I have changed the default claim to be able to pull the image and its being stored into my drupal public files, but when i try to open it or use it its invalid...

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Postponed: needs info

Version

1.7

Component

User interface

Created by

πŸ‡ΈπŸ‡ΎSyria alsammanKhaled

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡§πŸ‡ͺBelgium BramDriesen Belgium πŸ‡§πŸ‡ͺ

    Is the file saved to the filesystem actually valid? (Or is it for example a 0 byte file?)

    I never encountered this myself, nor do I have a keycloak set-up currently with profile pictures.

    Some exact steps to reproduce as well as keycloak settings would help.

    Can you also test this on the 2.2.x branch?

Production build 0.71.5 2024