问题
Is it possible to read a custom query string parameter from a SAML2 relying party request?.
Using the {OAUTH-KV:any custom query string} does not work.
example:
https://mytest.b2clogin.com/mytest.onmicrosoft.com/B2C_1A_TEST_SAML/samlp/sso/login?myparameter=true
I need to read the "myparameter" value into a claim.
回答1:
Hope you are trying to do the following:
<InputClaims>
<InputClaim ClaimTypeReferenceId="givenName" DefaultValue="{OAUTH-KV:name}" />
</InputClaims>
To get the value from the query string you have to configure the metadata of the technical profile and set the AlwaysUseDefaultValue property of the input claim like the following:
<Metadata>
<Item Key="IncludeClaimResolvingInClaimsHandling">true</Item>
</Metadata>
and
<InputClaims>
<InputClaim ClaimTypeReferenceId="givenName" AlwaysUseDefaultValue="true" DefaultValue="{OAUTH-KV:name}" />
</InputClaims>
来源:https://stackoverflow.com/questions/65593754/query-string-claims-resolver-with-saml2-b2c-custom-policy