OAuth issue for new users #3858

Closed
opened 2026-02-05 09:21:03 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @MohindharMukku on GitHub (Jul 11, 2024).

The bug

When a new user logins into Immich through Authentik using OAuth and enters their credentials, a 'Successfully logged in' message appears in the top left corner. However, The user encountering an error stating 'User already exists, but is linked to another account.' Old users who were created before version 1.107 can access the app. I'm a newbie. Please feel free to ask if you need any further information.

Screenshot from 2024-07-11 13-15-06

The OS that Immich Server is running on

Ubuntu 22.04.4 LTS

Version of Immich Server

v1.107.0

Version of Immich Mobile App

n/a

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  server:
#    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    restart: unless-stopped
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    ports:
      - 2283:3001
    #depends_on:
     # - redis
     # - database
    networks:
      - vpn
      - postgresql
      - backend  


  machine-learning:
#    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
#      ml-cache:
      - model-cache:/cache
    env_file:
      - stack.env
    restart: unless-stopped

volumes:
  redis:
  files:
  model-cache:

networks:
  vpn:
    external: true
  postgresql:
    external: true
  backend:
    external: true

Your .env content

UPLOAD_LOCATION=files
IMMICH_VERSION=release
DB_HOSTNAME=postgresql
DB_USERNAME=postgres
DB_PASSWORD=xxxxxxxxx
DB_DATABASE_NAME=immich

Reproduction steps

n/a

Relevant log output

[Nest] 17  - 07/09/2024, 11:12:58 AM   ERROR [Api:OPError: invalid_grant (The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client)
    at processResponse (/usr/src/app/node_modules/openid-client/lib/helpers/process_response.js:38:13)
    at Client.grant (/usr/src/app/node_modules/openid-client/lib/client.js:1354:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Client.callback (/usr/src/app/node_modules/openid-client/lib/client.js:493:24)
    at async AuthService.getOAuthProfile (/usr/src/app/dist/services/auth.service.js:225:28)
    at async AuthService.callback (/usr/src/app/dist/services/auth.service.js:151:25)
    at async OAuthController.finishOAuth (/usr/src/app/dist/controllers/oauth.controller.js:39:22)~hkg8duff] Failed to finish oauth
[Nest] 17  - 07/09/2024, 11:12:58 AM   ERROR [Api:OPError: invalid_grant (The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client)
    at processResponse (/usr/src/app/node_modules/openid-client/lib/helpers/process_response.js:38:13)
    at Client.grant (/usr/src/app/node_modules/openid-client/lib/client.js:1354:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Client.callback (/usr/src/app/node_modules/openid-client/lib/client.js:493:24)
    at async AuthService.getOAuthProfile (/usr/src/app/dist/services/auth.service.js:225:28)
    at async AuthService.callback (/usr/src/app/dist/services/auth.service.js:151:25)
    at async OAuthController.finishOAuth (/usr/src/app/dist/controllers/oauth.controller.js:39:22)~hkg8duff] OPError: invalid_grant (The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client)

Additional information

No response

Originally created by @MohindharMukku on GitHub (Jul 11, 2024). ### The bug When a new user logins into Immich through Authentik using OAuth and enters their credentials, a 'Successfully logged in' message appears in the top left corner. However, The user encountering an error stating 'User already exists, but is linked to another account.' Old users who were created before version 1.107 can access the app. I'm a newbie. Please feel free to ask if you need any further information. ![Screenshot from 2024-07-11 13-15-06](https://github.com/immich-app/immich/assets/127215223/4fe4e989-13ef-4107-8d2e-71e6d2e5ff22) ### The OS that Immich Server is running on Ubuntu 22.04.4 LTS ### Version of Immich Server v1.107.0 ### Version of Immich Mobile App n/a ### Platform with the issue - [ ] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # WARNING: Make sure to use the docker-compose.yml of the current release: # # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # # The compose file on main may not be compatible with the latest release. # name: immich services: server: # container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.transcoding.yml # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding restart: unless-stopped volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - stack.env ports: - 2283:3001 #depends_on: # - redis # - database networks: - vpn - postgresql - backend machine-learning: # container_name: immich_machine_learning # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable volumes: # ml-cache: - model-cache:/cache env_file: - stack.env restart: unless-stopped volumes: redis: files: model-cache: networks: vpn: external: true postgresql: external: true backend: external: true ``` ### Your .env content ```Shell UPLOAD_LOCATION=files IMMICH_VERSION=release DB_HOSTNAME=postgresql DB_USERNAME=postgres DB_PASSWORD=xxxxxxxxx DB_DATABASE_NAME=immich ``` ### Reproduction steps ```bash n/a ``` ### Relevant log output ```shell [Nest] 17 - 07/09/2024, 11:12:58 AM ERROR [Api:OPError: invalid_grant (The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client) at processResponse (/usr/src/app/node_modules/openid-client/lib/helpers/process_response.js:38:13) at Client.grant (/usr/src/app/node_modules/openid-client/lib/client.js:1354:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Client.callback (/usr/src/app/node_modules/openid-client/lib/client.js:493:24) at async AuthService.getOAuthProfile (/usr/src/app/dist/services/auth.service.js:225:28) at async AuthService.callback (/usr/src/app/dist/services/auth.service.js:151:25) at async OAuthController.finishOAuth (/usr/src/app/dist/controllers/oauth.controller.js:39:22)~hkg8duff] Failed to finish oauth [Nest] 17 - 07/09/2024, 11:12:58 AM ERROR [Api:OPError: invalid_grant (The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client) at processResponse (/usr/src/app/node_modules/openid-client/lib/helpers/process_response.js:38:13) at Client.grant (/usr/src/app/node_modules/openid-client/lib/client.js:1354:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Client.callback (/usr/src/app/node_modules/openid-client/lib/client.js:493:24) at async AuthService.getOAuthProfile (/usr/src/app/dist/services/auth.service.js:225:28) at async AuthService.callback (/usr/src/app/dist/services/auth.service.js:151:25) at async OAuthController.finishOAuth (/usr/src/app/dist/controllers/oauth.controller.js:39:22)~hkg8duff] OPError: invalid_grant (The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client) ``` ### Additional information _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#3858