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

Serialize StringCollection claim in the cookie #46

Open
izzulhaziq opened this issue Mar 5, 2019 · 11 comments
Open

Serialize StringCollection claim in the cookie #46

izzulhaziq opened this issue Mar 5, 2019 · 11 comments

Comments

@izzulhaziq
Copy link

I have the following setup for my B2C custom policy:

<TechnicalProfile Id="SM-AAD">
      <DisplayName>Session Mananagement Provider</DisplayName>
      <Protocol Name="Proprietary" Handler="Web.TPEngine.SSO.DefaultSSOSessionProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      <PersistedClaims>
        <PersistedClaim ClaimTypeReferenceId="objectId" />
        <PersistedClaim ClaimTypeReferenceId="signInName" />
        <PersistedClaim ClaimTypeReferenceId="email" />
        <PersistedClaim ClaimTypeReferenceId="groups" />
        <PersistedClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" />
      </PersistedClaims>
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="objectIdFromSession" DefaultValue="true"/>
      </OutputClaims>
    </TechnicalProfile>

Notice one of the persisted claim is of StringCollection <PersistedClaim ClaimTypeReferenceId="groups" /> type. The original values are like:

"groups": ["guid1", "guid2", "guid3", ...]

All the claims are persisted fine in the session (cookie) except the groups claim. Instead of properly serializing/deserializing the values, on the next token request retrieve from the b2c session cookie without going back to idp, we've gotten the following in the JWT instead:

"groups": ["System.Collections.Generic.List1[System.String]"],`

Is there a way to properly serialize StringCollection claim type?

@jpalo
Copy link

jpalo commented Oct 17, 2019

Any comments on this?

@katie199
Copy link

Is there any update on this? We have the same issue.

@izzulhaziq
Copy link
Author

We haven't been able to solve this as well, but we work around it by hooking up to azure function to serialize/deserialize in our b2c user journey. Not ideal, but that's the best one rather than having to go back to AAD for every token request, which were the original issue we had.

@katie199
Copy link

@izzulhaziq would it be possible for you to share the userjourney you used? I have been struggling with figuring out which journey is called when the user is reauthenticating and not logging in again. If you could, that would be awesome!!

@yoelhor
Copy link
Contributor

yoelhor commented Feb 6, 2020

Until this issue is fixed, as a temporary solution, you can use StringJoin and StringSplit claims transformations to serialise/deserialise the string collection to another string claim type.

@katie199
Copy link

katie199 commented Feb 7, 2020 via email

@CodyMorris
Copy link

Update on this please?

@Wessie1991
Copy link

i think its solved on the 6 march

@CodyMorris
Copy link

@izzulhaziq are you still experiencing this issue? about to take a second stab at solving it for my implementation.

@izzulhaziq
Copy link
Author

@izzulhaziq are you still experiencing this issue? about to take a second stab at solving it for my implementation.

@CodyMorris As mentioned in one of my replies, we ended up having Azure Function (basically calling a rest api) just to help with serializing and deserializing.

@michiproep
Copy link

I had a similar issue where a stringCollection could not be used in a refreshToken journey. The claim could not be read from the original accessToken and did result in an error.
Microsoft has deployed a fix for this today. and it seems to work:
" enabling "ResolveStringCollectionClaim" should resolve the problem according to the backend team "
Just curious if that also fixes your problem?

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

7 participants