I
Immich•5d ago
Shivam

Oauth doesnt work on mobile with 132.1

Hi, I am using authelia and caddy. Oauth works on web, does not work on mobile with error statuscode 500. Previously worked flawlessly for a year. In the Authelia logs I see: 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 My authelia config is pretty simple: - client_id: immich client_name: Immich client_secret: redacted public: false authorization_policy: household #this doesnt matter for debuging consent_mode: implicit redirect_uris: - app.immich:///oauth-callback - https://photos.example.com/auth/login - https://photos.example.com/user-settings scopes: - openid - profile - groups - email userinfo_signed_response_alg: "none" token_endpoint_auth_method: "client_secret_post" #I had to add this line recently, I think after 1.131, but it may have needed it earlier My immich oauth config is simple too, matching this: https://www.authelia.com/integration/openid-connect/immich/ No override for mobile redirect, never was needed in the past.
Authelia
immich
Integrating immich with the Authelia OpenID Connect 1.0 Provider.
131 Replies
Immich
Immich•5d ago
:wave: Hey @Shivam, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time). 2. :blue_square: read applicable release notes. 3. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed.
Alex Tran
Alex Tran•5d ago
@Daniel FYI
Daniel
Daniel•5d ago
Yup @Rhyn Hey!
Rhyn
Rhyn•5d ago
hey so what can i help with?
Daniel
Daniel•5d ago
Just wanted the both of you here So I saw a couple of things that were off Some of you had profiles in their scope, which you probably don't want Really your scope should just be openid, profile, email
Rhyn
Rhyn•5d ago
that was me ohh, nope i had profile not profiles
Shivam
ShivamOP•5d ago
you mean group right?
Rhyn
Rhyn•5d ago
no
Daniel
Daniel•5d ago
Oh sorry Yes I meant groups Don't have groups
Rhyn
Rhyn•5d ago
my scope is openid email profile offline_access
Shivam
ShivamOP•5d ago
I removed that but good call
Rhyn
Rhyn•5d ago
i added offline access yesterday didnt help though
Daniel
Daniel•5d ago
Yeah I'd try reverting it to make sure we're as basic as possible
Rhyn
Rhyn•5d ago
ok
Shivam
ShivamOP•5d ago
sorry to be more helpful, my scope is exactly "openid email profile" now
Daniel
Daniel•5d ago
And you both switched back to client_secret_basic?
Rhyn
Rhyn•5d ago
sec with basic it says failed to finish oauth time="2025-04-25T16:11:23+02:00" level=error msg="Access Request failed with error: Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). The request was determined to be using 'token_endpoint_auth_method' method 'client_secret_post', however the OAuth 2.0 client registration does not allow this method. The registered client with id 'ooxooMahsei5che.icho8heefuvo0ahri-en_2Ahyohjaiyu_Shi0ohm3Xo2feiw' is configured to only support 'token_endpoint_auth_method' method 'client_secret_basic'. Either the Authorization Server client registration will need to have the 'token_endpoint_auth_method' updated to 'client_secret_post'x or the Relying Party will need to be configured to use 'client_secret_basic'." (*workerPool).getCh.func1\nruntime/asm_amd64.s:1700 goexit" this error looping in authelia log probably i shouldve deleted the id 🙂
Daniel
Daniel•5d ago
The client id isn't confident
Rhyn
Rhyn•5d ago
i know
Shivam
ShivamOP•5d ago
some context, authelia 4.39 is defintely more strict with the oauth 2.0 standards. 4.39 came out a few months ago. It probably wont show that error in 4.38. However immich 1.30 definitely worked with authelia 4.39
Rhyn
Rhyn•5d ago
yeah i'm on latest authelia since it is out havent had problem before 132
Daniel
Daniel•5d ago
Yeah I can also give you some context. We used to not verifying the token at all which obviously is quite bad And allowed for some broken and lax oauth configs Could either of you try reverting to authelia 4.38?
Rhyn
Rhyn•5d ago
feels like immich is sending post instead of basic
Daniel
Daniel•5d ago
Yeah I think so too, looking into that right now
Rhyn
Rhyn•5d ago
ill revert in the meantime
Shivam
ShivamOP•5d ago
same
Rhyn
Rhyn•5d ago
yeah it will be bit complicated level=error msg="Error occurred running a startup check" error="error during schema migrate: current schema version is greater than the latest known schema version, you must downgrade to schema version 15 before you can use this version of Authelia" idk if i still have backup that old
Shivam
ShivamOP•5d ago
same issue
Daniel
Daniel•5d ago
Then that's fine Could either of you share their .well-known/openid-configuration json? Of authelia
Daniel
Daniel•5d ago
Specifically this part
No description
Rhyn
Rhyn•5d ago
"token_endpoint_auth_methods_supported": [ "client_secret_basic", "client_secret_post", "client_secret_jwt", "private_key_jwt", "none" ],
Shivam
ShivamOP•5d ago
same but authelia probably also validates with what the oauth client is allowed to use
Daniel
Daniel•5d ago
#17881 should fix that. Could either of you run the Immich version from that PR once it's built?
Immich
Immich•5d ago
[Pull Request] fix: oauth client auth method (immich-app/immich#17881)
jrasm91
jrasm91•5d ago
we also updated our 3rd party oauth library. it's probably fine to update your client configuration to use client_secret_post
Rhyn
Rhyn•5d ago
i gtg in 30 min or so so probably i can only try in the evening
Daniel
Daniel•5d ago
Should be up in 5min but whatever you prefer I don't think so actually
Rhyn
Rhyn•5d ago
ill try then
jrasm91
jrasm91•5d ago
why not
Daniel
Daniel•5d ago
I tried it and it didn't work ootb
Shivam
ShivamOP•5d ago
i can test, but am a bit green on how to do that. just change my docker image in the compose?
Daniel
Daniel•5d ago
I'll give you what you need
Rhyn
Rhyn•5d ago
will this fix the mobile client too? as far as i understand it is just to fix client secret basic
Daniel
Daniel•5d ago
Idk what's wrong with mobile yet. I'd hope it fixes both tbh
Rhyn
Rhyn•5d ago
i see
Daniel
Daniel•5d ago
Ok, the image tag is pr-17860 So instead of relase or a specific version tag, use that
Rhyn
Rhyn•5d ago
only for server or machine learning too?
Daniel
Daniel•5d ago
Only for server
Rhyn
Rhyn•5d ago
ok
Shivam
ShivamOP•5d ago
like this right? services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-pr-17860}
Daniel
Daniel•5d ago
Assuming IMMICH_VERSION isn't set, yes Really you should just update that env var though
Rhyn
Rhyn•5d ago
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} image: ghcr.io/immich-app/immich-server:pr-17860 ohh.. # is formating so instead the first line just use the second
Daniel
Daniel•5d ago
Yup
Shivam
ShivamOP•5d ago
good call it was
Rhyn
Rhyn•5d ago
same error
Daniel
Daniel•5d ago
:monkaHmm:
Shivam
ShivamOP•5d ago
same issues using client secret basic trying post now same with post. basic doesnt work with web and mobile, post works with web, not mobile
Rhyn
Rhyn•5d ago
yep
Daniel
Daniel•5d ago
What's the error you get when using mobile?
Rhyn
Rhyn•5d ago
from server? or client or authelia?
Daniel
Daniel•5d ago
All of them ideally lol
Rhyn
Rhyn•5d ago
No description
Rhyn
Rhyn•5d ago
No description
Daniel
Daniel•5d ago
Oh you know what This seems like a caching issue on mobile @Alex does mobile cache oauth config? If so, how can you clear that?
Rhyn
Rhyn•5d ago
that was my idea first so i deleted all my sessions
Alex Tran
Alex Tran•5d ago
it doesn't 🤔
Daniel
Daniel•5d ago
That wouldn't help for that
Rhyn
Rhyn•5d ago
in authelia.. same error but with a fresh session
Daniel
Daniel•5d ago
Yeah that wouldn't be bound to sessions If anything mobile would store somewhere that it was using basic auth And keep trying that
Rhyn
Rhyn•5d ago
the thing is i freshly installed the app yesterday so no cache whatsoever
Daniel
Daniel•5d ago
And you haven't tried it today with basic auth at some point?
Rhyn
Rhyn•5d ago
actually on my other phone where just upgraded from playstore it is still working with an old session i just tried.. havent deleted data yet tho ill try
Daniel
Daniel•5d ago
Ty :)
Rhyn
Rhyn•5d ago
same it flashes a login page for a second and goes back to internal error
Daniel
Daniel•5d ago
And authelia still says it tried basic auth? FWIW I am still confused why it's not accepting basic auth now tbh On web, could you click on the version on the bottom left?
Rhyn
Rhyn•5d ago
thats only for web
Shivam
ShivamOP•5d ago
Immich v1.132.2 ExifTool 13.00 Node.js v22.14.0 Libvips 8.16.1 ImageMagick 7.1.1-47 FFmpeg 7.0.2-7 Repository immich-app/immich Source 17860/merge@e1ee84f14 Build 14666744411 Version History Installed 1.132.2 on Apr 25, 2025 Installed 1.132.1 on Apr 24, 2025 Installed 1.131.3 on Apr 2, 2025 Installed 1.131.2 on Apr 1, 2025 Installed 1.130.3 on Mar 27, 2025
Rhyn
Rhyn•5d ago
on mobile it says
Rhyn
Rhyn•5d ago
No description
Daniel
Daniel•5d ago
Could you click on the source link? Oh hm
Rhyn
Rhyn•5d ago
i cant my setup automatically redirects to oauth
Rhyn
Rhyn•5d ago
and i cannot login with basic
Daniel
Daniel•5d ago
You're all good shivam already got it for me Yeah so that definitely isn't my PR
Shivam
ShivamOP•5d ago
ok, my bad
Daniel
Daniel•5d ago
Now it would be interesting to see what Rhyn got 😅 Can you log in with post on web right now?
Rhyn
Rhyn•5d ago
let me switch back to post so i can login
Shivam
ShivamOP•5d ago
is the docker image pr-17860 or pr-17881?
Rhyn
Rhyn•5d ago
No description
Shivam
ShivamOP•5d ago
as directed i used immich:pr-17860, but i can change to immich:pr-17881
Rhyn
Rhyn•5d ago
same 😄
Shivam
ShivamOP•5d ago
i believe here
Alex Tran
Alex Tran•5d ago
@Daniel need to bring out of draft to get it built I believe nvm I see it was built
Daniel
Daniel•5d ago
Oh wait did I mess up and gave you the wrong tag? :monakS:
Rhyn
Rhyn•5d ago
seems like it
Daniel
Daniel•5d ago
Yeah please change to 17881 Mb Apologies for the confusion :/
Alex Tran
Alex Tran•5d ago
lol need coffee man
Rhyn
Rhyn•5d ago
pulling
Daniel
Daniel•5d ago
No coffee after 4pm!
Alex Tran
Alex Tran•5d ago
its Friyayy
Daniel
Daniel•5d ago
Hehe fair :P
Shivam
ShivamOP•5d ago
yay, now web works with basic. mobile is still broken
Rhyn
Rhyn•5d ago
with the correct tag web is working with basic
Rhyn
Rhyn•5d ago
No description
Daniel
Daniel•5d ago
Wait what mobile is still broken? :monkaW: What's the error message there now?
Shivam
ShivamOP•5d ago
authelia | time="2025-04-25T10:54:21-04:00" level=error msg="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=192.168.2.2 same error as client post now
Rhyn
Rhyn•5d ago
yeah same as before
Daniel
Daniel•5d ago
Could you post your current authelia configs again?
Rhyn
Rhyn•5d ago
it is the same as in github issue but with basic
Shivam
ShivamOP•5d ago
- client_id: immich client_name: Immich client_secret: redacted public: false authorization_policy: household #this doesnt matter for debuging consent_mode: implicit redirect_uris: - app.immich:///oauth-callback - https://photos.example.com/auth/login - https://photos.example.com/user-settings scopes: - openid - profile - email userinfo_signed_response_alg: "none" token_endpoint_auth_method: "client_secret_basic" same
Rhyn
Rhyn•5d ago
ohh, i also deleted offline access from scopes
Daniel
Daniel•5d ago
I don't think you should be changing response modes The response should be code with basic auth But idk what that translates to in authelia, I'd just comment out that block for now I think Also, userinfo_signed_response_alg should be RS256 I think
Shivam
ShivamOP•5d ago
ill try that
Rhyn
Rhyn•5d ago
ill check
Shivam
ShivamOP•5d ago
ill keep it rs256, but same error. still works in web, mobile has statuscode 500 authelia | time="2025-04-25T11:03:59-04:00" level=error msg="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=192.168.2.2
Rhyn
Rhyn•5d ago
i have to go.. good luck with the debugging
Shivam
ShivamOP•5d ago
in immich settings, do i need a profile signing algorithm? currently is "none"
Daniel
Daniel•5d ago
Yes! That should also be RS256
jrasm91
jrasm91•5d ago
RS256 means the userinfo/profile is signed. I don't think that's normally the case.
Daniel
Daniel•5d ago
It is for me at least 😅
Alex Tran
Alex Tran•5d ago
Hey can you setup an account for me on your instance? and DM me the info, let me try logging in with mobile and trace the debug message
Shivam
ShivamOP•5d ago
yup, will do in 10 min, finishing up lunch
Alex Tran
Alex Tran•5d ago
no problem just DM me
noonamer
noonamer•4d ago
seems like I got unlucky settin OIDC 😄
Daniel
Daniel•4d ago
If you're using authelia it's a bit of a bad timing, yes 😅
noonamer
noonamer•4d ago
ahahah yes I just set it pr-17860 fixes it?
level=error msg="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
level=error msg="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
Daniel
Daniel•4d ago
Nope #17886 fixes it, but you'll need to wait for the mobile release there
Immich
Immich•4d ago
[Pull Request] fix: Authelia OAuth code verifier value contains invalid characters (immich-app/immich#17886)
noonamer
noonamer•4d ago
ahhh

Did you find this page helpful?