• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 28770625340 / 5
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions-deps-2d1112a488
DEFAULT BRANCH: master
Ran 06 Jul 2026 05:52AM UTC
Files 890
Run time 18s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Jul 2026 05:46AM UTC coverage: 50.979% (-15.7%) from 66.651%
28770625340.5

push

github

web-flow
fix(auth): handle user names from IdP and metadata refactor DEV-2394 (#7215)

### 📣 Summary
Map standard SCIM name attributes (givenName, familyName, and formatted)
natively to Kobo user fields (User.first_name, User.last_name, and
ExtraUserDetail.data['name']) during SCIM provisioning.

### 📖 Description
Previously, Kobo's SCIM implementation did not natively capture standard
name payload attributes from the IdP when creating or updating users.
This resulted in new users appearing with empty full names inside the
Kobo frontend. This PR resolves the issue by intercepting the standard
SCIM core schema attributes for names and mapping them to their
appropriate Kobo storage locations:

* `name.givenName` → `User.first_name`
* `name.familyName` → `User.last_name`
* `name.formatted` → `ExtraUserDetail.data['name']`

- Refactored the core extraction logic inside
kobo/apps/kobo_scim/utils.py. Created a helper function
`get_scim_value()` that parses both nested JSON dictionaries and SCIM
extension URN paths
- Unified Metadata Application: Updated `apply_scim_user_metadata()` to
natively process standard SCIM core fields alongside the configurable
custom metadata mappings (`USER_METADATA_FIELDS`). Because this utility
handles all mapping, POST, PUT, and PATCH API requests automatically
receive this behavior without duplicating code in the view layer
- Updated `ScimUserSerializer.get_name()` to fetch the formatted name
from ExtraUserDetail so the SCIM API returns the correct data. It safely
falls back to concatenating first_name and last_name if formatted is
omitted

### 👀 Preview steps
1. Simulate the IdP pushing a brand-new user with a full `name` payload.

```bash
curl -X POST http://kf.local.kbtdev.org/scim/v2/<IDP_SLUG>/Users \
  -H "Authorization: Bearer <SCIM_API_KEY>" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
    "userName": "curltestuser",
    "active": true,
    "emails": [
  ... (continued)

4540 of 12452 branches covered (36.46%)

18870 of 37015 relevant lines covered (50.98%)

0.51 hits per line

Source Files on job 28770625340.5
  • Tree
  • List 890
  • Changed 324
  • Source Changed 0
  • Coverage Changed 324
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 28770625340
  • 1ffdfc29 on github
  • Prev Job for on main (#28667492961.7)
  • Next Job for on main (#28864857429.9)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc