Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to login if no avatar is provided #904

Closed
konradmoesch opened this issue Jul 25, 2024 · 3 comments · Fixed by #905
Closed

unable to login if no avatar is provided #904

konradmoesch opened this issue Jul 25, 2024 · 3 comments · Fixed by #905
Labels
bug Something isn't working

Comments

@konradmoesch
Copy link

I am using user_oidc with Authentik. For the avatar, I have configured a mapping for the avatar to the avatar scope (in Authentik, the avatar is also available in the user.avatar variable and can be used in a scope mapping)

If no avatar is available in Authentik (I use the default gravatar,initials avatar providers setting), the affected user is unable to login. The following errors arise in nextcloud:

[PHP] error: Undefined variable $avatarContent at /var/www/nextcloud/apps/user_oidc/lib/Service/ProvisioningService.php#352
	GET /index.php/apps/user_oidc/code?code=XXXXXX
[index] error: OC_Image::loadFromData(): Argument #1 ($str) must be of type string, null given, called in /var/www/nextcloud/apps/user_oidc/lib/Service/ProvisioningService.php on line 352 in file '/var/www/nextcloud/lib/private/legacy/OC_Image.php' line 806
	GET /index.php/apps/user_oidc/code?code=XXXXXX

I believe we should have a check for null/empty before trying to set the avatar in nextcloud, or should have a default / fallback avatar that is set in this case.

@julien-nc julien-nc added the bug Something isn't working label Jul 26, 2024
@julien-nc
Copy link
Member

Thanks for reporting this. #905 should fix it. Could you try it?
For that you would need to save user_oidc/lib/Service/ProvisioningService.php somewhere and then replace it with this one:
https://raw.githubusercontent.com/nextcloud/user_oidc/e03ddaac78d2240e75aa215bbd29320f11ef5a74/lib/Service/ProvisioningService.php

There were a lot of mistakes in the provisioning code.

@julien-nc
Copy link
Member

The fix is included in v6.0.1. Could you confirm the issue is fixed and everything is fine on your side? Let's reopen this issue if something is still wrong.

@konradmoesch
Copy link
Author

Thanks! Now, login without avatar works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants