You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ShinyProxy is Unable to Parse String roles-claim #595
The value of the group claim should ideally be a JSON array, although ShinyProxy is more flexible on the format.
However, when the IdP actually send over a userinfo JSON (which happens to be the same as the decoded version of the ID Token JWT) that includes only a string instead of an array, ShinyProxy parsed the roles claim as an empty array (see logging below):
As a result, it doesn't actually recognize the role/group value. For example, the admin-groups doesn't work, and trying to query in an app's pod with echo $SHINYPROXY_USERGROUPS returns nothing.
I asked GPT-5.4 to inspect the relevant code in openanalytics/containerproxy, and it found that this behavior matches the current upstream implementation.
In OpenIDAuthenticationBackend.parseRolesClaim(...), the roles claim is handled as follows:
if the claim value is a Collection, it is converted to a list of roles
if the claim value is a String, the code tries to parse it as JSON
but it only accepts the result if that JSON parses to a list/array. That means a plain scalar string such as:
QS1-InnoTrans-ShinyProxy-Admin
is not treated as a single valid group. Instead, it goes through the string/JSON parsing branch and ends up as an empty list unless the value is array-like, e.g.:
["QS1-InnoTrans-ShinyProxy-Admin"]
This matches the debug output in this issue:
Matching claim found in user info: memberOf -> QS1-InnoTrans-ShinyProxy-Admin (class java.lang.String)
Parsed roles claim as JSON: memberOf -> []
GPT-5.4 also checked the current tests in containerproxy and found coverage for:
Java collections
proper JSON array strings
non-standard array-like strings
but not for the case where the claim is a plain scalar string that should be interpreted as a single group.
Activity
peter1357908 commentedon Jul 15, 2026
I asked GPT-5.4 to inspect the relevant code in
openanalytics/containerproxy, and it found that this behavior matches the current upstream implementation.In
OpenIDAuthenticationBackend.parseRolesClaim(...), the roles claim is handled as follows:but it only accepts the result if that JSON parses to a list/array. That means a plain scalar string such as:
QS1-InnoTrans-ShinyProxy-Adminis not treated as a single valid group. Instead, it goes through the string/JSON parsing branch and ends up as an empty list unless the value is array-like, e.g.:
["QS1-InnoTrans-ShinyProxy-Admin"]This matches the debug output in this issue:
GPT-5.4 also checked the current tests in containerproxy and found coverage for:
but not for the case where the claim is a plain scalar string that should be interpreted as a single group.
LEDfan commentedon Jul 27, 2026
Hi, thanks for opening this issue! This will be fixed in the next release :)