[PR #4148] [CLOSED] Allow roles to be an array #6313

Closed
opened 2026-02-05 10:29:05 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/4148
Author: @the-voidl
Created: 3/31/2023
Status: Closed

Base: developmentHead: fix-roles-as-array


📝 Commits (1)

  • 43eded9 allow roles to be an array

📊 Changes

1 file changed (+5 additions, -0 deletions)

View changed files

📝 app/Auth/Access/Oidc/OidcService.php (+5 -0)

📄 Description

Our oidc authentication endpoint (ZITADEL) does not return roles as simple array but single arrays per given role.

This pull request contains a simple fix to use the so given role names (keys of subarrays) as expected by BookStack.

An example payload of from ZITADEL looks like this...:

{
  "iss": "https://oicd.example.com",
  "aud": [
    "823417009781275377@oicd",  
    "593371374829733854@oicd",
    "298754342231354326@oicd",
    "207625234567516721@oicd",
    "111111111111111111"
  ],
  "azp": "298754342231354326@oicd",
  "at_hash": "h4ivntmqlr3v43_svT",
  "c_hash": "iv43lw34n4312A7af$_Vzc",

  "amr": [
    "password",
    "pwd",
    "mfa",
    "user"
  ],
  "exp": 1680264155,
  "iat": 1680260555,
  "auth_time": 1680247938,
  "email": "my.email@example.com",
  "email_verified": true,
  "family_name": "Name",
  "given_name": "GivenName",
  "name": "GivenName Name",
  "nickname": "GivenName Name",
  "preferred_username": "my.email@example.com",
  "sub": "111111111111111111",
  "updated_at": 1680255197,
  "urn:zitadel:iam:org:project:roles": {  <--- groups scope
    "admin": {                            <--- subarray for role admin: instance=12345, issuer=oicd.example.com
      "12345": "oicd.example.com"
    },
    "user": {
      "12345": "oicd.example.com"
    } 
  } 
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/4148 **Author:** [@the-voidl](https://github.com/the-voidl) **Created:** 3/31/2023 **Status:** ❌ Closed **Base:** `development` ← **Head:** `fix-roles-as-array` --- ### 📝 Commits (1) - [`43eded9`](https://github.com/BookStackApp/BookStack/commit/43eded9086c36f03b321f7259bf33bd6310fede1) allow roles to be an array ### 📊 Changes **1 file changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `app/Auth/Access/Oidc/OidcService.php` (+5 -0) </details> ### 📄 Description Our oidc authentication endpoint (ZITADEL) does not return roles as simple array but single arrays per given role. This pull request contains a simple fix to use the so given role names (keys of subarrays) as expected by BookStack. An example payload of from ZITADEL looks like this...: ``` { "iss": "https://oicd.example.com", "aud": [ "823417009781275377@oicd", "593371374829733854@oicd", "298754342231354326@oicd", "207625234567516721@oicd", "111111111111111111" ], "azp": "298754342231354326@oicd", "at_hash": "h4ivntmqlr3v43_svT", "c_hash": "iv43lw34n4312A7af$_Vzc", "amr": [ "password", "pwd", "mfa", "user" ], "exp": 1680264155, "iat": 1680260555, "auth_time": 1680247938, "email": "my.email@example.com", "email_verified": true, "family_name": "Name", "given_name": "GivenName", "name": "GivenName Name", "nickname": "GivenName Name", "preferred_username": "my.email@example.com", "sub": "111111111111111111", "updated_at": 1680255197, "urn:zitadel:iam:org:project:roles": { <--- groups scope "admin": { <--- subarray for role admin: instance=12345, issuer=oicd.example.com "12345": "oicd.example.com" }, "user": { "12345": "oicd.example.com" } } } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:29:05 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6313