Search code examples
mappingazure-ad-b2c

azure ad b2c restful api app insights where are the returned claims?


I have the following technical profile

        <TechnicalProfile Id="REST-GetTAndCsForUser-Test">
            <DisplayName>Get user extended profile Azure Function web hook</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://myurl</Item>
                <Item Key="SendClaimsIn">QueryString</Item>
                <Item Key="AuthenticationType">Bearer</Item>
                <Item Key="UseClaimAsBearerToken">accessToken</Item>
                <Item Key="AllowInsecureAuthInProduction">false</Item>
            </Metadata>
            <InputClaims>
                <InputClaim ClaimTypeReferenceId="accessToken" />
                <InputClaim ClaimTypeReferenceId="email" />
            </InputClaims>
            <OutputClaims>
                <OutputClaim ClaimTypeReferenceId="accepted"
                              />
                <OutputClaim ClaimTypeReferenceId="acceptionRequired" />
                <OutputClaim ClaimTypeReferenceId="tcDateAccepted" />
                <OutputClaim ClaimTypeReferenceId="tcVersionAccepted" />
            </OutputClaims>
        </TechnicalProfile>

When I test the endpoint with Postman, I get the following:

{
    "accepted": true,
    "acceptionRequired": false,
    "tcDateAccepted": "2023-05-10",
    "tcVersionAccepted": "latest"
}

But when I go to app insights I see the following:

App Insights

and I can't see what the endpoint is returning in app insights, I believe that my problem is around that, that I am not getting the same values or not getting nothing at all, so my question is in app insights, for a custom policy, for a technical profile that connects to a rest api, how are the parameters shown?


Solution

  • I found the problem. let's say my url was https://..../[email protected], myurl = ..../something when doing postman with that url, it was bringin the right results, but when I had that technical profile, it wasn't bringing anything, so it was the right results, because the api was returning something else, or nothing at all. So there was no error, in the app insights itself, it was on the technical profile,