fosrl / fosrl/pangolin

Android client: "failed to decode response - unexpected JSON" when using OIDC authentication

Open
#3,238 3 comments 0 reactions 0 assignees View on GitHub
needs investigating potential bug
Dominant language
TypeScript
Stars
22.8k
Forks
783
Avg merge
1d 7h
Merged PRs (30d)
52

Description

### Describe the Bug

I have been using Pangolin for over a year now without trouble, but recently tried setting up the Android client for the first time. When I go through the login flow using my OIDC IdP, the Android app shows a toast "failed to decode response - unexpected JSON token" (there might be more but it's cut off) and makes it no further. It sticks at the login screen with a spinner until you force quit and restart, at which point you will be prompted for login and run into the exact same problem.

As far as I can tell this problem is **unique to the Android client** - both web interface and Linux and MacOS clients work fine. I don't have an iOS device to test the iOS client.

### Environment

- OS Type & Version: Android 16, latest Pangolin client
- Pangolin Version: 1.18.4 (same problem was present in at least 1.18.0)
- Edition (Community or Enterprise): community
- Gerbil Version: 1.4.1
- Traefik Version: 3.7.5
- Newt Version: n/a
- Client Version: 0.1.12

### To Reproduce

- You'll need Pangolin set up against an OIDC IdP. I am using kanidm, but https://github.com/fosrl/pangolin/issues/2969 (closed for nonresponse) reports the exact same problem with pocketID
- Install the Android client, select custom server, enter server URL
- Android client pops open a webview for the login process, click the SSO button and go through the IdP login flow
- Once logged in in the webview, click Authorize in Pangolin to authenticate the App
- the webview closes and you are returned to an app, where you get a "checking login status" toast
- A few seconds later you get a "failed to decode response - unexpected JSON tok..." toast. The spinner will keep spinning, but from this point nothing else will happen until you FQ the app.

### Expected Behavior

I would expect logging in to work, of course---it seems like it's very close, especially since other pangolin clients are working. Unfortunately I am not sure how to get any additional debugging out of the Android app.

Contributor guide

Open the contributing guide

Research direction

Start with the Android client login flow and its webview-to-app handoff, reproducing the failure against an OIDC provider such as Kanidm or PocketID. No source file or test is named in the report; done means the Android client completes authentication without the unexpected-JSON error or a permanently spinning login screen.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
authentication, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.