Skip to content

providers/scim: scope-aware adoption - #26174

Merged
dominic-r merged 12 commits into
goauthentik:mainfrom
jsachs:bug/scim-scope-aware-adoption
Oct 27, 2026
Merged

dominic-r merged 12 commits into
goauthentik:mainfrom
jsachs:bug/scim-scope-aware-adoption

Conversation

@jsachs

@jsachs jsachs commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Details

What does this PR change?

Restricts SCIM discovery to users and groups within the provider’s configured synchronization scope.

  • Applies application access rules and service-account exclusions when matching users.
  • Applies group filters when matching groups.
  • Reuses the existing scope queries used for provisioning.

Why is this change needed?

Discovery currently links matching remote accounts to local users/groups even when they are outside the provider’s scope. This incorrectly marks those accounts as managed and can cause cleanup to delete accounts authentik should not have adopted.

How was this tested?

  • SCIM provider tests
  • Added coverage for username/email matching, service-account exclusions, and group filtering.
  • Full-sync regression verifies that excluded unmanaged accounts are left alone while previously managed accounts that leave scope are still deprovisioned.

Linked issues

#25333; addresses the scope-aware discovery behavior described in #24228. More work is required before fully closing these issues.


Checklist

  • The project has been linted, built, and tested (make all)
  • The documentation has been updated and formatted (make docs)
  • I have read the AI usage policy.

@netlify

netlify Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit c30a229
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6ab21d6618ae1100083c370e
😎 Deploy Preview https://deploy-preview-26174--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit c30a229
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6ab21d6618ae1100083c3709
😎 Deploy Preview https://deploy-preview-26174--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jsachs
jsachs force-pushed the bug/scim-scope-aware-adoption branch from 53333bb to 3acebb5 Compare September 15, 2026 14:37
@codecov

codecov Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.41%. Comparing base (a1e049b) to head (75b7e30).

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #26174       +/-   ##
===========================================
+ Coverage   80.08%   92.41%   +12.32%     
===========================================
  Files        1193     1194        +1     
  Lines       80838    80913       +75     
  Branches     4497     4497               
===========================================
+ Hits        64740    74775    +10035     
+ Misses      16032     6072     -9960     
  Partials       66       66               
Flag Coverage Δ
conformance 32.20% <0.00%> (-0.04%) ⬇️
e2e 36.86% <0.00%> (?)
integration 28.74% <0.00%> (-0.38%) ⬇️
rust 45.98% <ø> (ø)
unit 94.09% <100.00%> (+12.80%) ⬆️
unit-migrate 94.09% <100.00%> (+28.64%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@netlify

netlify Bot commented Sep 15, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 53333bb
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6aa957d7023f280008fe6645
😎 Deploy Preview https://deploy-preview-26174--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit c30a229
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6ab21d661f03c80008baa00e
😎 Deploy Preview https://deploy-preview-26174--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jsachs
jsachs marked this pull request as ready for review September 16, 2026 13:22
@jsachs
jsachs requested a review from a team as a code owner September 16, 2026 13:22
@dominic-r
dominic-r enabled auto-merge (squash) October 27, 2026 20:14
@dominic-r
dominic-r disabled auto-merge October 27, 2026 20:14
@dominic-r
dominic-r merged commit 9bbdfd9 into goauthentik:main Oct 27, 2026
163 checks passed
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
* main: (89 commits)
  providers/scim: scope-aware adoption (#26174)
  sources/ldap: respect accountExpires attributes (#26135)
  web/flows: never let continuous login block the final redirect (#26269)
  website: document password hash import restrictions (#24235)
  core: restrict imported password hashers (#24234)
  core, web: update translations (#27148)
  server: retry requests on connections closed by a recycled worker (#27275)
  packages/django-postgres-cache, flows: count cache keys in the database (#25808)
  events: simplify execution of event rules/notifications (#26873)
  core: bump github.com/pires/go-proxyproto from 0.15.0 to 0.16.0 (#27260)
  core: bump goauthentik/platform-ssh from 26.04-ak-0.72.3 to 26.04-ak-0.72.4 in /tests/e2e (#27263)
  core: bump goauthentik/selenium from 155.0-ak-0.72.3 to 155.0-ak-0.72.4 in /tests/e2e (#27261)
  core: bump astral-sh/uv from 0.13.5 to 0.13.6 in /lifecycle/container (#27264)
  core: bump jsonpatch from 1.35 to 1.36 (#27269)
  outposts: refresh channel groups on hello (#27136)
  core: bump certifi from 2026.10.19 to 2026.10.23 (#27266)
  core: bump pluggy from 1.6.0 to v1.7.0 (#27238)
  core: bump markupsafe from 3.0.3 to v3.0.4 (#27225)
  core: bump httptools from 0.8.0 to v0.9.0 (#27219)
  core: bump iniconfig from 2.3.0 to v2.3.1 (#27221)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants