Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending headers in a custom policy to call a restful provider in Azure AD B2C

Tags:

azure-ad-b2c

As part of a custom policy, we make a call to a Rest service. We need to send HTTP headers as part of this. Is it possible to send HTTP Headers as part of a RestfulProvider call?

We would at least like to send Accept=application/json to the service.

 <TechnicalProfile Id="Restful-ProxyAuthValidation">
  <DisplayName>Restful Claims Provider</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://contoso.azurewebsites.net/api/GFAuth</Item>
    <Item Key="AuthenticationType">None</Item>
    <Item Key="SendClaimsIn">Body</Item>
    <Item Key="issuer">https://contoso.azurewebsites.net/</Item>
  </Metadata>
  ....
like image 506
mdgdk Avatar asked Nov 08 '22 18:11

mdgdk


1 Answers

You can send the claims in headers by adding the following metadata item to the (RestfulProvider) technical profile:

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

All the InputClaims of the technical profile will be sent in headers.

like image 147
Omer Iqbal Avatar answered Dec 08 '22 22:12

Omer Iqbal