Error with OAuth after latest update unexpected JWT alg received, expected RS256, got: HS256 #2566

Closed
opened 2026-02-05 06:12:34 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @harrismcc on GitHub (Mar 12, 2024).

The bug

When attempting to login with OAuth (Using Authentik) in this latest version, I get the following error:

[Nest] 315  - 03/12/2024, 10:27:40 AM   ERROR [RPError: unexpected JWT alg received, expected RS256, got: HS256
    at Client.validateJWT (/app/immich/server/node_modules/openid-client/lib/client.js:911:13)
    at Client.validateIdToken (/app/immich/server/node_modules/openid-client/lib/client.js:766:60)
    at Client.callback (/app/immich/server/node_modules/openid-client/lib/client.js:505:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AuthService.getOAuthProfile (/app/immich/server/dist/domain/auth/auth.service.js:227:28)
    at async AuthService.callback (/app/immich/server/dist/domain/auth/auth.service.js:160:25)
    at async OAuthController.finishOAuth (/app/immich/server/dist/immich/controllers/oauth.controller.js:37:38)] Failed to finish oauth
[Nest] 315  - 03/12/2024, 10:27:40 AM   ERROR [RPError: unexpected JWT alg received, expected RS256, got: HS256
    at Client.validateJWT (/app/immich/server/node_modules/openid-client/lib/client.js:911:13)
    at Client.validateIdToken (/app/immich/server/node_modules/openid-client/lib/client.js:766:60)
    at Client.callback (/app/immich/server/node_modules/openid-client/lib/client.js:505:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AuthService.getOAuthProfile (/app/immich/server/dist/domain/auth/auth.service.js:227:28)
    at async AuthService.callback (/app/immich/server/dist/domain/auth/auth.service.js:160:25)

The OS that Immich Server is running on

Unraid

Version of Immich Server

v1.98.2

Version of Immich Mobile App

v1.98.1

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A (not using docker-compose)

Your .env content

![CleanShot 2024-03-12 at 10 57 18](https://github.com/immich-app/immich/assets/740503/bd78b7ab-5a1e-4ee1-98bb-59cc03d13ba3)

Reproduction steps

1. Upgrade Immich to latest
2. Upgrade postgres to `tensorchord/pgvecto-rs:pg15-v0.2.0`
3. Attempt to login using OAuth w/ Authentik as provider

Additional information

Infinite OAuth login loop caused by error:
CleanShot 2024-03-12 at 10 39 56

Originally created by @harrismcc on GitHub (Mar 12, 2024). ### The bug When attempting to login with OAuth (Using Authentik) in this latest version, I get the following error: ``` [Nest] 315 - 03/12/2024, 10:27:40 AM ERROR [RPError: unexpected JWT alg received, expected RS256, got: HS256 at Client.validateJWT (/app/immich/server/node_modules/openid-client/lib/client.js:911:13) at Client.validateIdToken (/app/immich/server/node_modules/openid-client/lib/client.js:766:60) at Client.callback (/app/immich/server/node_modules/openid-client/lib/client.js:505:18) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AuthService.getOAuthProfile (/app/immich/server/dist/domain/auth/auth.service.js:227:28) at async AuthService.callback (/app/immich/server/dist/domain/auth/auth.service.js:160:25) at async OAuthController.finishOAuth (/app/immich/server/dist/immich/controllers/oauth.controller.js:37:38)] Failed to finish oauth [Nest] 315 - 03/12/2024, 10:27:40 AM ERROR [RPError: unexpected JWT alg received, expected RS256, got: HS256 at Client.validateJWT (/app/immich/server/node_modules/openid-client/lib/client.js:911:13) at Client.validateIdToken (/app/immich/server/node_modules/openid-client/lib/client.js:766:60) at Client.callback (/app/immich/server/node_modules/openid-client/lib/client.js:505:18) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AuthService.getOAuthProfile (/app/immich/server/dist/domain/auth/auth.service.js:227:28) at async AuthService.callback (/app/immich/server/dist/domain/auth/auth.service.js:160:25) ``` ### The OS that Immich Server is running on Unraid ### Version of Immich Server v1.98.2 ### Version of Immich Mobile App v1.98.1 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML N/A (not using docker-compose) ``` ### Your .env content ```Shell ![CleanShot 2024-03-12 at 10 57 18](https://github.com/immich-app/immich/assets/740503/bd78b7ab-5a1e-4ee1-98bb-59cc03d13ba3) ``` ### Reproduction steps ```bash 1. Upgrade Immich to latest 2. Upgrade postgres to `tensorchord/pgvecto-rs:pg15-v0.2.0` 3. Attempt to login using OAuth w/ Authentik as provider ``` ### Additional information Infinite OAuth login loop caused by error: ![CleanShot 2024-03-12 at 10 39 56](https://github.com/immich-app/immich/assets/740503/6ff1e5f3-66fe-4963-aac0-78bd9856345a)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#2566