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

supabase / auth / 28178220953
71%

Build:
DEFAULT BRANCH: master
Ran 25 Jun 2026 02:45PM UTC
Jobs 1
Files 196
Run time 1min
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

25 Jun 2026 02:40PM UTC coverage: 71.287% (+0.2%) from 71.072%
28178220953

push

github

web-flow
feat(custom-oauth): add per-provider custom_claims_allowlist (#2576)

## What kind of change does this PR introduce?

Feature

 ## What

Adds a per-provider `custom_claims_allowlist` to custom OAuth/OIDC
providers: a flat list of raw IdP claim keys that get copied verbatim
into `custom_claims` on the user's `identity_data` /
`raw_user_meta_data`.

  ```
  PATCH /admin/custom-providers/custom:acme
  { "custom_claims_allowlist": ["groups", "org_id", "mail", "sn"] }

Result, queryable in a before insert on auth.users trigger (and stored
in the auth.identities table as well for future queries):
"custom_claims": { "groups": [...], "org_id": "...", "mail": "...",
"sn": "..." }
```

## Why

Admins integrating non-standard IdPs need to read provider-specific claims (e.g. groups, mail, nlEduPersonProfileId) that don't map to standard fields. This is the allowlist design rather than a denylist (previous implementation: https://github.com/supabase/auth/pull/2520):

- No Azure "re-add stripped claims" risk: we only copy keys explicitly named, so a parser that strips a claim stays authoritative.
- No reflection, no exhaustive exclusion set to maintain, no ordering hazard with ParseIDToken.

Design decisions
- Default = empty -> capture nothing. Opt-in only.
- text[] column (slices.String), matching `scopes` / `acceptable_client_ids`.
- Distinct from attribute_mapping: the allowlist copies raw source keys into the opaque custom_claims bucket; attribute_mapping remaps typed fields. No privilege-escalation surface, so no blocked-target guard (only a non-empty-entry check).
- Capture runs before applyAttributeMapping at all sources (OAuth userinfo, OIDC userinfo) via one captureAllowedClaims helper.

77 of 89 new or added lines in 4 files covered. (86.52%)

17930 of 25152 relevant lines covered (71.29%)

665.04 hits per line

Uncovered Changes

Lines Coverage ∆ File
8
82.49
15.27% internal/api/provider/custom_oauth.go
2
65.15
0.98% internal/api/custom_oauth_admin.go
2
67.55
-0.19% internal/api/external.go
Jobs
ID Job ID Ran Files Coverage
1 28178220953.1 25 Jun 2026 02:45PM UTC 196
71.29
GitHub Action Run
Source Files on build 28178220953
  • Tree
  • List 196
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • acecb063 on github
  • Prev Build on master (#27964305858)
  • Delete
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