Skip to content

sources/oauth: save returned oauth refresh tokens and add slack provider - #18501

Merged
PeshekDotDev merged 6 commits into
mainfrom
save-refresh-tokens
Dec 2, 2025
Merged

PeshekDotDev merged 6 commits into
mainfrom
save-refresh-tokens

Conversation

@PeshekDotDev

Copy link
Copy Markdown
Contributor

Details

Adds slack as a custom oauth provider in order to properly pull nested access and refresh tokens

Also adds ability to store refresh tokens


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make docs)

@PeshekDotDev
PeshekDotDev requested review from a team as code owners December 1, 2025 16:17
@netlify

netlify Bot commented Dec 1, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit 62a97d4
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/692e11d158394100087e218d

@netlify

netlify Bot commented Dec 1, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations canceled.

Name Link
🔨 Latest commit 62a97d4
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/692e11d1da22fd0008f698c0

@netlify

netlify Bot commented Dec 1, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit 62a97d4
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/692e11d1a37fd400080d548c

@codecov

codecov Bot commented Dec 1, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.48387% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.75%. Comparing base (46b889e) to head (62a97d4).
⚠️ Report is 38 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
authentik/sources/oauth/types/slack.py 68.96% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18501      +/-   ##
==========================================
+ Coverage   92.74%   92.75%   +0.01%     
==========================================
  Files         902      913      +11     
  Lines       49363    49969     +606     
==========================================
+ Hits        45781    46351     +570     
- Misses       3582     3618      +36     
Flag Coverage Δ
e2e 44.53% <25.00%> (-0.22%) ⬇️
integration 22.88% <25.00%> (-0.21%) ⬇️
unit 91.19% <85.48%> (+0.03%) ⬆️
unit-migrate 91.23% <85.48%> (+0.03%) ⬆️

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

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

Comment thread authentik/sources/oauth/models.py Resolved
PeshekDotDev and others added 2 commits December 1, 2025 11:14
Co-authored-by: Jens L. <[email protected]>
Signed-off-by: Connor Peshek <[email protected]>
@github-actions

github-actions Bot commented Dec 1, 2025 •

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-62a97d47dff70943651fbcb4b0f27eb5badc6d15
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-62a97d47dff70943651fbcb4b0f27eb5badc6d15

Afterwards, run the upgrade commands from the latest release notes.

@PeshekDotDev PeshekDotDev self-assigned this Dec 1, 2025
@PeshekDotDev
PeshekDotDev merged commit 45ee4af into main Dec 2, 2025
@PeshekDotDev
PeshekDotDev deleted the save-refresh-tokens branch December 2, 2025 17:49
rissson pushed a commit to atereshkin/authentik that referenced this pull request Dec 3, 2025
…der (goauthentik#18501)

* sources/oauth: save returned oauth refresh tokens

* Update authentik/sources/oauth/models.py

Co-authored-by: Jens L. <[email protected]>
Signed-off-by: Connor Peshek <[email protected]>

* lint

* add tests

* fix proper id setting

* update id test

---------

Signed-off-by: Connor Peshek <[email protected]>
Co-authored-by: connor peshek <[email protected]>
Co-authored-by: Jens L. <[email protected]>
Co-authored-by: connor peshek <[email protected]>
GirlBossRush added a commit that referenced this pull request Dec 9, 2025
* enterprise: add users and events export (reports app)

* enterprise/reports: replace assert with AsertionError so that the assumption check is not lost when compiling to optimised byte code

* enterprise/reports: use ConditionalInheritance with ExportMixin to make reduce coupling of enterprise with the rest of authentik

* enterprise/reports: use custom iterative File to save data export instead of accessing default_storage directly, so all the FileField.save logic can run correctly (e.g. creating directories)

* enterprise/reports: change app label to simply "authentik_reports"

* wip

Signed-off-by: Marc 'risson' Schmitt <[email protected]>

* update for new file api

Signed-off-by: Marc 'risson' Schmitt <[email protected]>

* lint

Signed-off-by: Marc 'risson' Schmitt <[email protected]>

* Apply suggestions from code review

Signed-off-by: Dominic R <[email protected]>

* wip

* sources/oauth: save returned oauth refresh tokens and add slack provider (#18501)

* sources/oauth: save returned oauth refresh tokens

* Update authentik/sources/oauth/models.py

Co-authored-by: Jens L. <[email protected]>
Signed-off-by: Connor Peshek <[email protected]>

* lint

* add tests

* fix proper id setting

* update id test

---------

Signed-off-by: Connor Peshek <[email protected]>
Co-authored-by: connor peshek <[email protected]>
Co-authored-by: Jens L. <[email protected]>
Co-authored-by: connor peshek <[email protected]>

* core: custom avatar url improvements (#10525)

Co-authored-by: Dominic R <[email protected]>

* website/integrations: add salesforce (#18516)

Co-authored-by: connor peshek <[email protected]>
Co-authored-by: dewi-tik <[email protected]>
Co-authored-by: Dominic R <[email protected]>

* endpoints: implement endpoint stage (#18468)

* endpoints: implement endpoint stage

Signed-off-by: Jens Langhammer <[email protected]>

* format

Signed-off-by: Jens Langhammer <[email protected]>

* fix mismatched label

Signed-off-by: Jens Langhammer <[email protected]>

* fix url in mdm config

Signed-off-by: Jens Langhammer <[email protected]>

* rephrase

Signed-off-by: Jens Langhammer <[email protected]>

* and API & UI

Signed-off-by: Jens Langhammer <[email protected]>

* add deprecated support and deprecate gdtc

Signed-off-by: Jens Langhammer <[email protected]>

* add stage mode

Signed-off-by: Jens Langhammer <[email protected]>

* fixup

Signed-off-by: Jens Langhammer <[email protected]>

* rework stage slightly, add frontend

Signed-off-by: Jens Langhammer <[email protected]>

* include jwks, add iat and exp

Signed-off-by: Jens Langhammer <[email protected]>

* fix tests

Signed-off-by: Jens Langhammer <[email protected]>

* set kid

Signed-off-by: Jens Langhammer <[email protected]>

* include device details in event list

Signed-off-by: Jens Langhammer <[email protected]>

* format

Signed-off-by: Jens Langhammer <[email protected]>

* implement device summary

Signed-off-by: Jens Langhammer <[email protected]>

* add remaining tables

Signed-off-by: Jens Langhammer <[email protected]>

* revert sanitize

Signed-off-by: Jens Langhammer <[email protected]>

* fix uuid format issues

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Jens Langhammer <[email protected]>

* web/flows: update default background image (#18540)

Signed-off-by: Jens Langhammer <[email protected]>

* website/integrations: add hoop.dev (#17868)

Co-authored-by: iops <[email protected]>
Co-authored-by: Dominic R <[email protected]>

* website: Docusaurus 3.9.2 (#18506)

* endpoints/stage: v2, better error handling, more settings (#18545)

* add options, idle fallback

Signed-off-by: Jens Langhammer <[email protected]>

* delete other device tokens during enroll

Signed-off-by: Jens Langhammer <[email protected]>

* better error handling

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Jens Langhammer <[email protected]>

* website: Glossary (#16007)

* website: Glossary

fix minor issues

wip

Apply suggestion from @dominic-r

Signed-off-by: Dominic R <[email protected]>

anchor to param

wip

wip

at least the lockfile changes now

sure

a-z first as tana asked

idk why i switched in the first place

wip

wip

lock

lockfiles are hard

wip

please work

no have?

Revert "no have?"

This reverts commit 743dbc1.

* changed to sentence-case capitalization

---------

Co-authored-by: Tana M Berry <[email protected]>

* web/i18n: Locale Context Merge Branch (#18426)

* web: Update fonts to Patternfly 5 variants.

* Fix order of heading override.

* web: Flesh out locale context.

* Fix Han pattern.

* Remove comment.

* Add additional regional codes.

* Clarify comment.

* Fix typos.

* web/i18n: Add locale-specific font overrides.

* Fix stale session in locale lifecycle.

* core, web: Fix Han language codes.

* Fix warnings about invalid BCP language code.

* Build translations.

* Add locale relative labels.

* Add locale translations for Finnish and Portuguese.

* Fix XLIFF errors.

* Clean up labels.

* Tidy regions.

* Match region comment.

* Update extracted values.

* Fix locale switch not triggering on source language.

* Split labels.

* Clean up labels.

* providers/scim: cache ServiceProviderConfig (#18047)

* Update authentik/enterprise/reports/api/reports.py

Co-authored-by: Jens L. <[email protected]>
Signed-off-by: Alexander Tereshkin <[email protected]>

* enterprise/reports: got rid of unnecessary method-level import

* enterprise/reports: celan up code duplication in data export generation (invoke viewset.filter_queryset directly instead of replicating it)

* enterprise/reports: add check for app label when switching on content types

* enterprise/reports: make hyperlink field on Notification larger so it can fit the security token in the export file URL

* enterprise/reports: add is_superuser back in users export

* enterprise/reports: split tests into multiple files

* Apply suggestions from code review

Signed-off-by: Dewi Roberts <[email protected]>

* Fixed prettier issue

* Update web/src/admin/events/DataExportListPage.ts

Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Alexander Tereshkin <[email protected]>

* Update web/src/admin/events/DataExportListPage.ts

Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Alexander Tereshkin <[email protected]>

* Update web/src/admin/events/EventListPage.ts

Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Alexander Tereshkin <[email protected]>

* Update web/src/admin/reports/ExportButton.ts

Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Alexander Tereshkin <[email protected]>

* Update web/src/admin/reports/ExportButton.ts

Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Alexander Tereshkin <[email protected]>

* Update web/src/admin/users/UserListPage.ts

Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Alexander Tereshkin <[email protected]>

* Update web/src/elements/notifications/NotificationDrawer.ts

Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Alexander Tereshkin <[email protected]>

* Update web/src/elements/sidebar/SidebarItem.css

Co-authored-by: Teffen Ellis <[email protected]>
Signed-off-by: Alexander Tereshkin <[email protected]>

* enterprise/reports: resolve code review merge errors

* enterprise/reports: remove the export button from the dom flow (by settings display:none) when there's no license

* enterprise/reports: improve docs

* include notification link in email

Signed-off-by: Jens Langhammer <[email protected]>

* format

Signed-off-by: Jens Langhammer <[email protected]>

* enterprise/reports: remove assignment assertion in ExportButton.ts

* cleanup tests after perm update

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Signed-off-by: Dominic R <[email protected]>
Signed-off-by: Connor Peshek <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Alexander Tereshkin <[email protected]>
Signed-off-by: Dewi Roberts <[email protected]>
Co-authored-by: Marc 'risson' Schmitt <[email protected]>
Co-authored-by: Dominic R <[email protected]>
Co-authored-by: Connor Peshek <[email protected]>
Co-authored-by: connor peshek <[email protected]>
Co-authored-by: Jens L. <[email protected]>
Co-authored-by: connor peshek <[email protected]>
Co-authored-by: Konrad Mösch <[email protected]>
Co-authored-by: dewi-tik <[email protected]>
Co-authored-by: shcherbak <[email protected]>
Co-authored-by: iops <[email protected]>
Co-authored-by: Teffen Ellis <[email protected]>
Co-authored-by: Tana M Berry <[email protected]>
Co-authored-by: Jens L. <[email protected]>
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.

2 participants