Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot handle Roles as array from OIDC #52

Closed
Lumrenion opened this issue Nov 29, 2020 · 0 comments
Closed

Cannot handle Roles as array from OIDC #52

Lumrenion opened this issue Nov 29, 2020 · 0 comments

Comments

@Lumrenion
Copy link
Contributor

I am using Keycloak as Identity Provider. Per default, the mapper to map roles or groups creates an array of role/group names:

Sun, 29 Nov 2020 12:18:43 +0000 [DEBUG] request="c1e61e29ed447" component="Causal.Oidc.Service.AuthenticationService": Resource owner retrieved - {"sub":"0019d14c-80ab-47e3-930b-4109ba1ad921","Roles":["GroupA"],"email_verified":true,"email":"test@example.com","username":"ssouser"}

I did not find a possibility to configure Keycloak to create a comma separated list instead. So I think this is a bug or missing feature in OIDC. The following line should be changed:

$roles = GeneralUtility::trimExplode(',', $info['Roles'], true);

into

$roles = is_array($info['Roles']) ? $info['Roles'] : GeneralUtility::trimExplode(',', $info['Roles'], true);
xperseguers pushed a commit that referenced this issue Jan 19, 2021
…d list (#53)

Co-authored-by: Philipp Seßner <philipp.sessner@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant