Account Linking example needs to be updated to use alternativeSecurityId
See original GitHub issueIt seems that the account linking example is now out of date. It refers to the userIdentities
claim being of type userIdentityCollection
, which it is now not. Instead, any reference to UserIdentity
and UserIdentityCollection
are now AlternativeSecurityId
and AlternativeSecurityIdCollection
. This change seems to be spread across a few different docs, i.e. how to link is in this repo, but how to use alternativeSecurityId
with respect to linking and claim transformations is found elsewhere
If I have time to change these samples and test them, which is unlikely, then I will. Otherwise, for those who need to know what to do, I’ll outline the steps below.
I have had to refactor the account linking example to use, in all policies that reference them. the following:
identityProvider
in place ofissuer
alternativeSecurityId
in place ofuserIdentity
alternativeSecurityIdCollection
in place ofuserIdentityCollection
alternativeSecurityIds
in place ofuserIdentities
Also, the transformations that relate to modifying and creating userIdentity
now need to refer to alternativeSecurityId
, as follows:
<ClaimsTransformation Id="CreateUserIdentity" TransformationMethod="CreateAlternativeSecurityId">
<InputClaims>
<InputClaim ClaimTypeReferenceId="issuerUserId" TransformationClaimType="key" />
<InputClaim ClaimTypeReferenceId="identityProvider" TransformationClaimType="identityProvider" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="alternativeSecurityId" TransformationClaimType="alternativeSecurityId" />
</OutputClaims>
</ClaimsTransformation>
<ClaimsTransformation Id="CreateUserIdentityToLink" TransformationMethod="CreateAlternativeSecurityId">
<InputClaims>
<InputClaim ClaimTypeReferenceId="issuerUserIdToLink" TransformationClaimType="key" />
<InputClaim ClaimTypeReferenceId="identityProviderToLink" TransformationClaimType="identityProvider" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="userIdentityToLink" TransformationClaimType="alternativeSecurityId" />
</OutputClaims>
</ClaimsTransformation>
<ClaimsTransformation Id="AppendUserIdentity" TransformationMethod="AddItemToAlternativeSecurityIdCollection">
<InputClaims>
<InputClaim ClaimTypeReferenceId="alternativeSecurityId" TransformationClaimType="item" />
<InputClaim ClaimTypeReferenceId="alternativeSecurityIds" TransformationClaimType="collection" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="alternativeSecurityIds" TransformationClaimType="collection" />
</OutputClaims>
</ClaimsTransformation>
<ClaimsTransformation Id="AppendUserIdentityToLink" TransformationMethod="AddItemToAlternativeSecurityIdCollection">
<InputClaims>
<InputClaim ClaimTypeReferenceId="userIdentityToLink" TransformationClaimType="item" />
<InputClaim ClaimTypeReferenceId="alternativeSecurityIds" TransformationClaimType="collection" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="alternativeSecurityIds" TransformationClaimType="collection" />
</OutputClaims>
</ClaimsTransformation>
<ClaimsTransformation Id="RemoveUserIdentityFromCollectionByIssuer" TransformationMethod="RemoveAlternativeSecurityIdByIdentityProvider">
<InputClaims>
<InputClaim ClaimTypeReferenceId="identityProviderToUnlink" TransformationClaimType="identityProvider" />
<InputClaim ClaimTypeReferenceId="alternativeSecurityIds" TransformationClaimType="collection" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="alternativeSecurityIds" TransformationClaimType="collection" />
</OutputClaims>
</ClaimsTransformation>
<ClaimsTransformation Id="ExtractIdentityProviders" TransformationMethod="GetIdentityProvidersFromAlternativeSecurityIdCollectionTransformation">
<InputClaims>
<InputClaim ClaimTypeReferenceId="alternativeSecurityIds" TransformationClaimType="alternativeSecurityIdCollection" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="identityProviders" TransformationClaimType="identityProvidersCollection" />
</OutputClaims>
</ClaimsTransformation>
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:16 (5 by maintainers)
Top GitHub Comments
I’ve added these for others who have hit the same issues as me.
@filipemiguelaugusto Looks like you have commented out
AddItemToUserIdentityCollection
. Your policy is mixing AlternativeSecurityId and UserIdentity, for exampleCreateAlternativeSecurityId
is expecting claim type of data typeAlternativeSecurityId
but youralternativeSecurityId
is of typeuserIdentity
. I would suggest renaming all your claim types, transformations to alternativeSecurityId and make sure there is no UserIdentiteis appeared in the policy.