Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

azure ad b2c - Query String Claims Resolver with SAML2 B2C Custom Policy

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...