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

fixed an issue to enable claim to display, if it contains an array value #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juhaalhojoki
Copy link

Purpose

I noticed that when I setup my custom authentication provider to return an array of values in a claim, the SPA App did not display them causing some confusion that my custom authentication provider is doing something that is not allowed.
Custom roles missin:
image
However when checking the token with jwt.ms, I noticed that the claim is there with the values the custom claims provider added:
image
Figured out why the React SPA App was not showing a claim with an array value and was able to fix it:
image

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:


## How to Test
*  Get the code
*  Setup a custom claims provider to return multiple customRoles like the sample in this article illustrates
https://learn.microsoft.com/en-us/entra/identity-platform/custom-extension-get-started?context=%2Fazure%2Factive-directory%2Fexternal-identities%2Fcustomers%2Fcontext%2Fcustomers-context&tabs=entra-admin-center%2Chttp at 1.2 Edit the function
![image](https://github.com/Azure-Samples/ms-identity-ciam-javascript-tutorial/assets/17412854/a386374a-f6e1-40eb-a445-b8f3a830b428)
*  Notice that the React SPA App now is able to display the customRoles with a comma separated values of the array. Just like the jwt.ms displays the claim.


git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install


* Test the code
<!-- Add steps to run the tests suite and/or manually test -->

## What to Check
Verify that the following are valid
* ...

## Other Information
<!-- Add any other helpful information that may be needed here. -->

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

Successfully merging this pull request may close these issues.

1 participant