0
votes

I'm trying to call a rest api in a technical profile which requires parameters to be passed to it through the header, but I'm unable to do so. I have:

        <TechnicalProfile Id="techProfile1">
          <DisplayName>Technical Profile 1</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="ServiceUrl">https://xxxxxxx.azurewebsites.net/api/controller/action</Item>
            <Item Key="AuthenticationType">Basic</Item>
            <Item Key="SendClaimsIn">Header</Item>
            <Item Key="AllowInsecureAuthInProduction">true</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="BasicAuthenticationUsername" StorageReferenceId="xxxxxx" />
            <Key Id="BasicAuthenticationPassword" StorageReferenceId="xxxxxx" />
          </CryptographicKeys>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="claimName1" PartnerClaimType="paramName1" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="output1"/>
          </OutputClaims>
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
        </TechnicalProfile>

Where the value I'm trying to pass in is the ClaimName1 claim, and the parameter name is paramName1. Am I correct in using the InputClaim section for this?

The response back that I get is: AADB2C90075: The claims exchange 'techProfile1' specified in step '3' returned HTTP error response with Code 'InternalServerError' and Reason 'Internal Server Error'.

Am I right in assuming that the parameter is not being passed to the api? When I change the ServiceUrl to: https://xxxxxxx.azurewebsites.net/api/controller/action?paramName1=yyyy (where yyyy is the value held in the claimName1 claim), then it works as expected.

1

1 Answers

0
votes
<Item Key="SendClaimsIn">Header</Item> 

instead of the above one try the below one

 <Item Key="SendClaimsIn">QueryString</Item>

This will add the input claim as query param.