OIDC Authentication fails with "state parameter mismatch" #835

Closed
opened 2026-04-24 23:39:58 +02:00 by adam · 12 comments
Owner

Originally created by @k8ieone on GitHub (Jan 11, 2024).

Steps to reproduce

  1. Use Authentik OIDC for authentication
  2. Try logging in with the mobile app
  3. "State parameter mismatch"

Expected behaviour

The user should be logged in.

Actual behaviour

The login fails and the web browser ends up on this page:
Screenshot_20240110-134039.png

(up in the left corner)

ResizedImage_2024-01-10_13-41-43_1209.png

Logging in to the web interface through OIDC works as expected. That's why I'm reporting this here.

Environment data

Audiobookshelf Version:

  • Android App 0.9.71-beta

Android Issue

Android version: 13

Device model: Wingtech T-Phone

Stock or customized system: Stock (pretty much vanilla Android)

Originally created by @k8ieone on GitHub (Jan 11, 2024). ### Steps to reproduce 1. Use Authentik OIDC for authentication 2. Try logging in with the mobile app 3. "State parameter mismatch" ### Expected behaviour The user should be logged in. ### Actual behaviour The login fails and the web browser ends up on this page: ![Screenshot_20240110-134039.png](https://github.com/advplyr/audiobookshelf-app/assets/28711937/b4cdc05f-f647-475b-a2a1-78d4d95ed33f) (up in the left corner) ![ResizedImage_2024-01-10_13-41-43_1209.png](https://github.com/advplyr/audiobookshelf-app/assets/28711937/e3a509a5-1f89-4226-94d2-f7a6e59a9fd1) Logging in to the web interface through OIDC works as expected. That's why I'm reporting this here. ### Environment data Audiobookshelf Version: - Android App `0.9.71-beta` #### Android Issue Android version: 13 Device model: Wingtech T-Phone Stock or customized system: Stock (pretty much vanilla Android)
adam added the bug label 2026-04-24 23:39:58 +02:00
adam closed this issue 2026-04-24 23:39:58 +02:00
Author
Owner

@advplyr commented on GitHub (Jan 11, 2024):

What is the version of the server?

@advplyr commented on GitHub (Jan 11, 2024): What is the version of the server?
Author
Owner

@k8ieone commented on GitHub (Jan 11, 2024):

@advplyr 2.7.1, brand new deployment.

@k8ieone commented on GitHub (Jan 11, 2024): @advplyr 2.7.1, brand new deployment.
Author
Owner

@k8ieone commented on GitHub (Jan 14, 2024):

Update: I managed to log in today.

I still ended up on the "state parameter mismatch" page, but after tapping on "open", the app proceeded to log in.

Previous attempts resulted in the app either freezing or crashing.

I did not change anything about my setup, so I'm not sure why it works now.

@k8ieone commented on GitHub (Jan 14, 2024): Update: I managed to log in today. I still ended up on the "state parameter mismatch" page, but after tapping on "open", the app proceeded to log in. Previous attempts resulted in the app either freezing or crashing. I did not change anything about my setup, so I'm not sure why it works now.
Author
Owner

@advplyr commented on GitHub (Jan 23, 2024):

I'm not sure either. Are you still having odd behavior?

@advplyr commented on GitHub (Jan 23, 2024): I'm not sure either. Are you still having odd behavior?
Author
Owner

@Sapd commented on GitHub (Jan 24, 2024):

Update: I managed to log in today.

I still ended up on the "state parameter mismatch" page, but after tapping on "open", the app proceeded to log in.

Previous attempts resulted in the app either freezing or crashing.

I did not change anything about my setup, so I'm not sure why it works now.

Thats weird. I suspect its something with the Browser on your Android because if you get the screen "Open in another App" it means the auth was successful. Maybe your browser reloads the page for a second time or so AND shows "Open in another app", which would lead to that kind of message you see in the background.

@Sapd commented on GitHub (Jan 24, 2024): > Update: I managed to log in today. > > I still ended up on the "state parameter mismatch" page, but after tapping on "open", the app proceeded to log in. > > Previous attempts resulted in the app either freezing or crashing. > > I did not change anything about my setup, so I'm not sure why it works now. Thats weird. I suspect its something with the Browser on your Android because if you get the screen "Open in another App" it means the auth was successful. Maybe your browser reloads the page for a second time or so AND shows "Open in another app", which would lead to that kind of message you see in the background.
Author
Owner

@k8ieone commented on GitHub (Jan 30, 2024):

@Sapd That could be it. Just for the record - the browser used here is Fennec.

I just tested again today. The "state parameter mismatch" page still loads, but the login succeeds after pressing "open".

@k8ieone commented on GitHub (Jan 30, 2024): @Sapd That could be it. Just for the record - the browser used here is [Fennec](https://f-droid.org/packages/org.mozilla.fennec_fdroid/). I just tested again today. The "state parameter mismatch" page still loads, but the login succeeds after pressing "open".
Author
Owner

@advplyr commented on GitHub (Feb 3, 2024):

Have you tested with another browser?

@advplyr commented on GitHub (Feb 3, 2024): Have you tested with another browser?
Author
Owner

@k8ieone commented on GitHub (Feb 5, 2024):

@advplyr No, but I can try. Which browsers should I test?

@k8ieone commented on GitHub (Feb 5, 2024): @advplyr No, but I can try. Which browsers should I test?
Author
Owner

@Sapd commented on GitHub (Feb 5, 2024):

@k8ieone You can just try any on the device. Chrome or Firefox for example.

@Sapd commented on GitHub (Feb 5, 2024): @k8ieone You can just try any on the device. Chrome or Firefox for example.
Author
Owner

@k8ieone commented on GitHub (Feb 8, 2024):

@Sapd I tested with Firefox and Chrome. Firefox has the same behavior.

Chrome went right back to the app after signing in to my IDP. This is how I think it should look.

So it looks like this is a Firefox-only issue (Fennec is a fork).

@k8ieone commented on GitHub (Feb 8, 2024): @Sapd I tested with Firefox and Chrome. Firefox has the same behavior. Chrome went right back to the app after signing in to my IDP. This is how I think it should look. So it looks like this is a Firefox-only issue (Fennec is a fork).
Author
Owner

@advplyr commented on GitHub (Mar 21, 2024):

I'm not sure if there is anything we can do about this. We aren't doing anything special but a redirect

@advplyr commented on GitHub (Mar 21, 2024): I'm not sure if there is anything we can do about this. We aren't doing anything special but a redirect
Author
Owner

@k8ieone commented on GitHub (Mar 23, 2024):

Since logging in works I think we can close this.

@k8ieone commented on GitHub (Mar 23, 2024): Since logging in works I think we can close this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#835