nextcloud / nextcloud/user_oidc

[Bug]: The default profile picture gets the wrong value (letters) on some pages with OIDC

Open
#965 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug fix in progress
Dominant language
PHP
Stars
181
Forks
60
Avg merge
7h 34m
Merged PRs (30d)
26

Description

⚠️ This issue respects the following points: ⚠️
Bug description

The default profile image letters (that should be first letter from the first two words in the "Display Name") is getting the "Username" instead on some pages when using "OpenID Connect" with Keycloak.

Steps to reproduce

If there is a local user it shows the correct data and I see these are in the "oc_users" table in the database with "Display Name" set.
The users from "OpenID Connect" look like they are in the "oc_user_oidc" table in the database and they have all have "Display Name" set as the users name and "Username" is a GUID.

The pages I've found shows the wrong pictures (and sometimes cache them on other sites) are the following:

  • Profile page:

Always shows the username in the picture.
This page also cache:s the wrong image for the local user so it shows wrong on some other pages (For example the picture in top right) until you clean your cache.

Wrong letters (Should be "UA")
Image

The cache:d image in top right: (Correct)
Image

The cache:d image in top right: (Wrong)
Image

  • Edit "Personal info" page:

Shows wrong in the top left profile picture but not in the "preview" profile page.
This page also cache:s the wrong image for the local user so it shows wrong on some other pages (For example the picture in top right) until you clean your cache.

Example:
Image

  • Contacts page (App):

The default list that gets the users from the system (principals/system/system) is wrong in the initial list (and "Not grouped").

The default contact list:
Image

If you for example create a circle and add members then it is correct there:
Image

Also correct under members list:
Image

Expected behavior

The default profile picture should always use the letters in "Display Name" if it is set.

Nextcloud Server version

30

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report
{
    "system": {
        "debug": true,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "30.0.1.1",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\Illustrator",
            "OC\\Preview\\Movie",
            "OC\\Preview\\MSOffice2003",
            "OC\\Preview\\MSOffice2007",
            "OC\\Preview\\MSOfficeDoc",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\PDF",
            "OC\\Preview\\Photoshop",
            "OC\\Preview\\Postscript",
            "OC\\Preview\\StarOffice",
            "OC\\Preview\\SVG",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\Font"
        ],
        "preview_max_x": 1024,
        "preview_max_y": 768,
        "preview_max_scale_facto": 1,
        "auth.bruteforce.protection.enabled": true,
        "trashbin_retention_obligation": "auto,7",
        "skeletondirectory": "",
        "defaultapp": "",
        "activity_expire_days": 14,
        "integrity.check.disabled": false,
        "updater.release.channel": "beta",
        "theme": "",
        "default_phone_region": "SE",
        "maintenance": false,
        "allow_local_remote_servers": true,
        "oidc_login_auto_redirect": true,
        "oidc_login_redir_fallback": true,
        "default_language": "SE",
        "loglevel": 3,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_send_plaintext_only": true
    }
}

### List of activated Apps

Enabled:
  - activity: 3.0.0
  - admin_audit: 1.20.0
  - app_api: 4.0.0
  - calendar: 5.0.1
  - circles: 30.0.0-dev
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contacts: 6.1.0
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - groupfolders: 18.0.3
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - mail: 4.0.1
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - ocs_api_viewer: 1.0.7
  - onlyoffice: 9.4.0
  - password_policy: 2.0.0
  - photos: 3.0.2
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - richdocuments: 8.5.1
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - spreed: 20.0.1
  - support: 2.0.0
  - systemtags: 1.20.0
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_oidc: 6.0.1
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - bruteforcesettings: 3.0.0 (installed 2.8.0)
  - encryption: 2.18.0
  - files_external: 1.22.0
  - firstrunwizard: 3.0.0 (installed 2.17.0)
  - survey_client: 2.0.0 (installed 1.16.0)
  - suspicious_login: 8.0.0
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - user_ldap: 1.21.0
Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

Do I need to create a bug report in the contact app aswell?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the profile page, Personal info page, and Contacts page behavior with local and OpenID Connect users, comparing Display Name with the GUID username. Trace how the user_oidc backend supplies profile data and how the profile image is cached. Done means default initials consistently come from Display Name and stale incorrect images are not retained.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.