Query String Claims Resolver with SAML2 B2C Custom Policy

左心房为你撑大大i 提交于 2021-02-08 11:15:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!