Having Azure API Gateway with an exteral IdP (Okta) we setup a simple and working setup. The API Gateway is able to authenticate and authorize the JWT token and call the backend service (App Logic or Azure function).
Next to the invoking the backend services, the API Gateway can pass claims from the JWT token
<validate-jwt header-name="Authorization" failed-validation-httpcode="401" failed-validation-error-message="No JWT token" require-expiration-time="true" require-scheme="Bearer" require-signed-tokens="true" clock-skew="10" output-token-variable-name="jwttoken">
<set-header name="jwt-token" exists-action="append">
<value><![CDATA[@(context.Variables.ContainsKey("jwttoken") ? (((Jwt)(context.Variables["jwttoken"])).Subject) : "") ]]></value>
</set-header>
The backend services (AppLogic) are authorized using its SAS token, so we have to remove the Authorization header. I'm considering to send the JWT token to the backend anyway, but so far I found no way to do so (serialize the jwttoken variable, the API GW doesn't allow to call the .ToString() method).
Q: Is there / How do I send the original JWT token to the backend (in another header?)