Skip to content

sources/kerberos, sources/ldap: Save source connections when linking an existing user/group - #26059

Merged
BeryJu merged 4 commits into
goauthentik:mainfrom
sgebauer:fix/save-source-connections
Sep 21, 2026
Merged

BeryJu merged 4 commits into
goauthentik:mainfrom
sgebauer:fix/save-source-connections

Conversation

@sgebauer

Copy link
Copy Markdown
Contributor

Details

What does this PR change?

When linking an existing user or group to LDAP and/or Kerberos, make sure we save the corresponding source connection, like we do when enrolling a new user.

Why is this change needed?

This change fixes #26057 and probably also #21326.

How was this tested?

This was tested manually by patching the existing 2026.8.0 container image, and then running through the reproduction steps from #26057.

Linked issues

closes #26057


Checklist

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

@netlify

netlify Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 1fd5264
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6aacdca56f0348000805314c
😎 Deploy Preview https://deploy-preview-26059--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.

@netlify

netlify Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 1fd5264
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6aacdca5bef6c60008c01460
😎 Deploy Preview https://deploy-preview-26059--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 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 1fd5264
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6aacdca5a140ec00081e7bdc
😎 Deploy Preview https://deploy-preview-26059--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.

@dewi-tik

Copy link
Copy Markdown
Contributor

Is this ready for review? Are you still planning more changes/testing?

@codecov

codecov Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.95%. Comparing base (fd5aee1) to head (45283dc).
⚠️ Report is 32 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26059      +/-   ##
==========================================
- Coverage   91.98%   91.95%   -0.03%     
==========================================
  Files        1174     1174              
  Lines       76184    76214      +30     
  Branches     4056     4056              
==========================================
+ Hits        70078    70086       +8     
- Misses       6064     6086      +22     
  Partials       42       42              
Flag Coverage Δ
conformance 33.52% <0.00%> (-0.02%) ⬇️
e2e 38.30% <3.03%> (+0.19%) ⬆️
integration 30.22% <0.00%> (-0.05%) ⬇️
rust 42.89% <ø> (ø)
unit 93.54% <100.00%> (+<0.01%) ⬆️
unit-migrate 93.55% <100.00%> (+<0.01%) ⬆️

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.

@sgebauer

Copy link
Copy Markdown
Contributor Author

Yes, this is basically ready.

I just ran into some problems getting the build environment set up, so I only tested it by patching the existing 2026.8.0 image instead of running a full build.

@sgebauer
sgebauer marked this pull request as ready for review September 17, 2026 17:10
@sgebauer
sgebauer requested a review from a team as a code owner September 17, 2026 17:10
@dewi-tik
dewi-tik requested a review from BeryJu September 18, 2026 06:39
Signed-off-by: Jens Langhammer <[email protected]>

@BeryJu BeryJu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, although the fact that this hasn't come up before gives me the gut feeling that this might've been intentional, but I cannot think of a reason why

cc @gergosimonyi @rissson if either of you can think of a reason why this wasn't there before

@rissson

rissson commented Sep 21, 2026

Copy link
Copy Markdown
Member

This LGTM, weird we didn't have that before

@BeryJu BeryJu added the backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 label Sep 21, 2026
@BeryJu
BeryJu merged commit 6f2e7a8 into goauthentik:main Sep 21, 2026
139 checks passed
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

🍒 Cherry-pick to version-2026.8 created: #26313

kensternberg-authentik added a commit that referenced this pull request Sep 21, 2026
* main: (38 commits)
  providers/oauth2: track RP logins per session for logout (#26310)
  common/saml: Fix metadata to serve only the leaf of a PEM chain (#26273)
  website: bump the build group in /website with 3 updates (#26292)
  website/docs: rac: explain authorization reuse and disconnect behavior (#26288)
  core: bump astral-sh/uv from 0.12.16 to 0.12.17 in /lifecycle/container (#26294)
  sources/kerberos, sources/ldap: Save source connections when linking an existing user/group (#26059)
  core: bump goauthentik/fips-python from `863aded` to `05c6c36` in /lifecycle/container (#26295)
  core: bump library/node from `14bf3ea` to `d82e1d0` in /lifecycle/container (#26240)
  ci: bump the codeql group across 1 directory with 3 updates (#26304)
  ci: bump codecov/codecov-action from 7.1.0 to 7.1.1 in /.github/actions/test-results (#26307)
  ci: bump codecov/codecov-action from 7.1.0 to 7.1.1 (#26305)
  ci: bump taiki-e/install-action from 2.87.13 to 2.87.15 in /.github/actions/setup (#26306)
  core: bump debugpy from 1.8.21 to 1.8.22 (#26303)
  core: bump openid/conformance-suite from release-v5.3.0 to release-v5.3.1 in /tests/openid_conformance (#26301)
  core: bump jwcrypto from 1.6.0 to 1.6.1 (#26302)
  core: bump openid/conformance-suite/nginx from release-v5.3.0 to release-v5.3.1 in /tests/openid_conformance (#26300)
  core: bump ruff from 0.16.7 to 0.16.8 (#26299)
  core: bump sentry-sdk from 2.69.1 to 2.69.2 (#26298)
  core: bump goauthentik/selenium from 151.0-ak-0.61.0 to 152.0-ak-0.62.0 in /tests/e2e (#26293)
  website/docs: fix two word-swap typos (#26283)
  ...
melizeche pushed a commit that referenced this pull request Oct 14, 2026
…an existing user/group (cherry-pick #26059 to version-2026.8) (#26313)

sources/kerberos, sources/ldap: Save source connections when linking an existing user/group (#26059)

* sources/kerberos, sources/ldap: Save source connections when linking an existing user or group

* add tests



---------

Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Sven Gebauer <[email protected]>
Co-authored-by: Dewi Roberts <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kerberos and LDAP sources do not create source connections for existing users

4 participants