Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server)!: oauth encryption algorithm setting #6818

Merged
merged 4 commits into from
Feb 2, 2024

Conversation

danieldietzler
Copy link
Member

@danieldietzler danieldietzler commented Jan 31, 2024

Notes from @jrasm91:

Warning

Breaking Change

OAuth setups using HS256 (mainly Authentik) will need to either (1) update the signing algorithm in Immich or (2) specify a signing key in the provider settings (so that it uses RS256 instead).

Specify a signing key in Authentik:

Screencast.from.02-02-2024.12.05.04.AM.webm

New Immich OAuth Setting

image

Background

RS256 is generally better than HS256. RS256 is pretty much the most commonly used algorithm. The client library we use for open-id defaults to RS256. It's very easy to setup Authentik without specifying a signing key, which will default to use HS256. The original implementation added a hack/fallback to HS256 in some conditions to try to handle that situation. The current code removes the fallback, and adds a specific Signing Algortithm setting which can be explicitly set. Alternatively, the issue could be fixed by specifying a signing key in Authentik.

References:

Copy link

cloudflare-workers-and-pages bot commented Jan 31, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2045473
Status: ✅  Deploy successful!
Preview URL: https://ba621f74.immich.pages.dev
Branch Preview URL: https://feat-oauth-encryption-algori.immich.pages.dev

View logs

@danieldietzler danieldietzler force-pushed the feat/oauth-encryption-algorithm-setting branch from f0d17b7 to 8bb21c5 Compare February 1, 2024 21:31
@jrasm91 jrasm91 force-pushed the feat/oauth-encryption-algorithm-setting branch from 8bb21c5 to 2045473 Compare February 2, 2024 04:55
@jrasm91 jrasm91 changed the title feat(server): oauth encryption algorithm setting feat(server)!: oauth encryption algorithm setting Feb 2, 2024
@jrasm91 jrasm91 marked this pull request as ready for review February 2, 2024 05:13
@jrasm91 jrasm91 merged commit d3404f9 into main Feb 2, 2024
27 checks passed
@jrasm91 jrasm91 deleted the feat/oauth-encryption-algorithm-setting branch February 2, 2024 05:27
@halkeye
Copy link
Contributor

halkeye commented Feb 21, 2024

Well this was a fun redirect loop.

For anyone else surprised by this and disabled local login

insert into system_config VALUES ('oauth.signingAlgorithm', '"HS256"');

I'm still trying to figure out how to configure authentik with cert-manager to use rs instead

@muava12
Copy link

muava12 commented Feb 23, 2024

i'm a noob in outh, how to do "(1) update the signing algorithm in Immich " as mentioned in release note??

@jrasm91
Copy link
Contributor

jrasm91 commented Feb 23, 2024

i'm a noob in outh, how to do "(1) update the signing algorithm in Immich " as mentioned in release note??

Log in as the immich admin and click on "Administration" then "Settings" then "OAuth"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Supporting multiple OAuth token algorithms
4 participants