Skip to content

Oauth fails on mobile with 1.132.0 #17825

Closed

Description

@Etienne-bdt

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

Oauth does not complete on mobile but works as expected on web

The OS that Immich Server is running on

Debian 12

Version of Immich Server

v1.132.0

Version of Immich Mobile App

v1.132.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

name: immich

services:
  immich-server:
    container_name: immich_server
    labels:
      - "com.centurylinklabs.watchtower.monitor-only=true"
    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 
    devices:
      - /dev/dri:/dev/dri
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    ports:
      - 2283:2283
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false
    environment:
      PUID: 109
      PGID: 117

  redis:
    container_name: immich_redis
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    image: docker.io/redis:6.2-alpine@sha256:2d1463258f2764328496376f5d965f20c6a67f66ea2b06dc42af351f75248792
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always
    environment: 
      PUID: 109
      PGID: 117
  database:
    container_name: immich_postgres
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      PUID: 109
      PGID: 117
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
    restart: always

Your .env content

UPLOAD_LOCATION=/srv/immich-app/library
DB_DATA_LOCATION=/srv/immich-app/postgres
IMMICH_VERSION=release
DB_PASSWORD=Redacted
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

  1. Install v1.132.0 of the immich app and server
  2. Log in using OAuth, complete login on the provider
  3. Screen switches back to the server selection screen with an error in the logs

Relevant log output

Missing authentication, server, or endpoint info from the local store

Unable to login using offline or online methods - Logging out completely

Error Logging out

Additional information

OAuth configuration from Immich :

ISSUER URL *

https://pocketid.mydomain.fr

CLIENT ID *

an ID

CLIENT SECRET *

the right secret

SCOPE *

openid email profile picture

SIGNING ALGORITHM *

RS256

PROFILE SIGNING ALGORITHM *
none

STORAGE LABEL CLAIM *

email

STORAGE QUOTA CLAIM *

immich_quota

DEFAULT STORAGE QUOTA (GIB) *

0

BUTTON TEXT

Login with PocketID

AUTO REGISTER

False

AUTO LAUNCH

False

MOBILE REDIRECT URI OVERRIDE

False

Provider side :

CallBack URLs

https://photo.mydomain.fr/auth/login
app.immich:///oauth-callback

Activity

  1. bo0tzz commented on Apr 23, 2025

    @bo0tzz
    Member

    How did you install the app?

  2. Etienne-bdt commented on Apr 23, 2025

    @Etienne-bdt
    ContributorAuthor

    app-release.apk from the 1.132.0 release

    (uninstalled previous one to avoid conflict)

  3. aviv926 commented on Apr 23, 2025

    @aviv926
    Collaborator

    Closed as duplicate.
    Answer in this case:
    #17827 (comment)

  4. Etienne-bdt commented on Apr 23, 2025

    @Etienne-bdt
    ContributorAuthor

    By all means I don't see why you would close that issue as duplicate @aviv926. As mentioned both in the 1.132.0 discussion with @alextran1502 and in my report here, the app is the most up to date as I installed it straight from GitHub unlike #17827

  5. danieldietzler commented on Apr 23, 2025

    @danieldietzler
    Member

    Nope @aviv926, they're saying they're using the latest version.

  6. aviv926 commented on Apr 23, 2025

    @aviv926
    Collaborator

    Nope @aviv926, they're saying they're using the latest version.

    I'm confused, so the problem isn't due to the version of the app according to what Zack wrote?

  7. Caelanj commented on Apr 24, 2025

    @Caelanj

    Nope @aviv926, they're saying they're using the latest version.

    I'm confused, so the problem isn't due to the version of the app according to what Zack wrote?

    Correct, the issue occurs even with same version of app and server.

  8. zedocrob commented on Apr 24, 2025

    @zedocrob

    Updated 1.132.1 apk from github but Oauth2 not working now with Authelia on mobile. (docker latest)
    Also had to change token_endpoint_auth_method: 'client_secret_basic entry to token_endpoint_auth_method: 'client_secret_post since 1.132.0 in Authelia config.

    Image

  9. alextran1502 commented on Apr 24, 2025

    @alextran1502
    Member

    Updated 1.132.1 apk from github but Oauth2 not working now with Authelia on mobile. (docker latest)
    Also had to change token_endpoint_auth_method: 'client_secret_basic entry to token_endpoint_auth_method: 'client_secret_post since 1.132.0 in Authelia config.

    Image

    @zedocrob after changing it, does it work?

  10. Rhyn commented on Apr 24, 2025

    @Rhyn

    @zedocrob after changing it, does it work?

    No, that only fixes the web auth, the app still doesn't work

    In the authelia log i can see this error:

    Access Request failed with error: The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client. The PKCE code verifier must only contain [a-Z], [0-9], '-', '.', '_', '~'." method=POST path=/api/oidc/token remote_ip=xx.xx.xx.xx

  11. DAS-Grim commented on Apr 25, 2025

    @DAS-Grim

    Like lucienastie reported in the closed 17864 "duplicate" issue I'm seeing 500 errors using OAuth in general, not just the mobile apps. I'm using Entra as the provider and it works fine if I roll the Immich docker back to v1.131.3 it starts working again. So seems to be an issue in the update unless there is just some change that now needs to be made to get it working again.

  12. alextran1502 commented on Apr 25, 2025

    @alextran1502
    Member

    For those that have OAutb error. Can you help showing your detailed OAuth setup (screenshot would be best), please blur out the secrets so that we can replicate and troubleshoot the issue?

  13. 16 remaining items

  14. Str1atum commented on Apr 26, 2025

    @Str1atum

    So we have to wait for the next release for this to be fixed?
    At the moment for me neither web nor mobile app work.

    Also if web isn't working, add this to your authelia immich config:

    token_endpoint_auth_method: "client_secret_post"

    Pretty sure you'll need to keep this line after the fix too, but we'll see

    Thanks, that brought web OAuth login back to life

  15. jrasm91 commented on Apr 27, 2025

    @jrasm91
    Member

    I believe we will do a release Monday morning

  16. ilopmar commented on Apr 27, 2025

    @ilopmar

    Oauth login in web also failed for me. I've changed this (as mentioned in this thread):

    Also had to change token_endpoint_auth_method: 'client_secret_basic entry to token_endpoint_auth_method: 'client_secret_post since 1.132.0 in Authelia config.

    And now it works in web :)

    You to double check. Do we need to keep token_endpoint_auth_method: 'client_secret_post since' or is it just a temporary workaround?

  17. nebb00 commented on Apr 28, 2025

    @nebb00

    Any ideas how I do this, when I cannot login (i disabled password auth)

  18. SamsiFPV commented on Apr 28, 2025

    @SamsiFPV

    @nebb00 You have to change the token_endpoint_auth_method in your authelia config. No changes in immich, except waiting for the fix for the mobile app.

  19. nebb00 commented on Apr 28, 2025

    @nebb00

    @nebb00 You have to change the token_endpoint_auth_method in your authelia config. No changes in immich, except waiting for the fix for the mobile app.

    Perfect thanks, all working. Turns out i didnt even have token_endpoint_auth_method set for immich at all

  20. DAS-Grim commented on Apr 29, 2025

    @DAS-Grim

    The Web failures have not been fixed I still can't log in to the Web with OAuth using Entra as the provider on 1.132.3. As far as I can find the change some People are using to get web working agian isnt possible with Entra

  21. Etienne-bdt commented on Apr 29, 2025

    @Etienne-bdt
    ContributorAuthor

    I used pocketID with no issues, I don't know if you have pkce enabled but it has prevented me from login in when I set it up.

    And I too couldn't do the token basic/post change

  22. DAS-Grim commented on Apr 29, 2025

    @DAS-Grim

    I used pocketID with no issues, I don't know if you have pkce enabled but it has prevented me from login in when I set it up.

    And I too couldn't do the token basic/post change

    I don't believe PKCE is setup. I have opened issue #17958 for the problem

  23. Plungestep commented on Jun 3, 2025

    @Plungestep

    I installed the latest .apk file on Android from GitHub, and I’m using OAuth (Authentik). App version is 1.134.0. Immich on my sever is 1.134.0.

    I get a “Redirect URI Error - The request fails due to a missing, invalid, or mismatching redirection URI (redirect_uri)” error once the Authentik page loads. I can then “Go home” on Authentik’s site and sign in correctly and open Immich, but the App doesn’t remember the logged-in state. When I go back to the app, it says “Platform exception (Canceled, user canceled login, null, null)”. Except I didn’t cancel the login, I successfully authenticated in Authentik.

    Any ideas? Is this related?

  24. jrasm91 commented on Jun 3, 2025

    @jrasm91
    Member

    You might have missed the breaking changes here: #12151

    The mobile app requires Authentik to include the app.immich:///oauth-callback redirect url. Once that is listed, you should be able to login.

  25. Plungestep commented on Jun 4, 2025

    @Plungestep

    That was my issue, thanks! I wasn't aware that I could have two Redirect URIs, one for the web and one for mobile.

  26. MeikelLP commented on Aug 5, 2026

    @MeikelLP

    I have this issue since 3.x only on mobile.

    I have the callback url set to app.immich:///oauth-callback and it worked with < 3.x but broke since then
    Login in browser works as expected. Only the app is broken.

    I found not logs neither in Immich nor in keycloak

    The app logs:

    Received Authorization URL: https://some-keycloak/realms/homelab/protocol/openid-connect/auth?redirect_uri=app.immich%3A%2F%2F%2Foauth-callback&scope=openid+email+profile&state=Bt274gChRZtaqSiq9xhWqKYZxxWaGYyZ&code_challenge=YchqzkYSWcqPLwbN3iAX3RW-YKyThuofRUsMTBtFLlk&code_challenge_method=S256&client_id=immich&response_type=code
    

    Edit: found the issue:

    I'm using URL Checker as default "browser" which redirects to Brave. The redirection triggers the app to "close" and Immich thinks the auth was canceled

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions