question

BruceHarrison-5147 avatar image
0 Votes"
BruceHarrison-5147 asked BruceHarrison-5147 commented

AAD B2C Custom Policies: Add Pragma Header to token response?

Is there any way to add additional headers to the JWT token response message? The system I am integrating with expects a Pragma header for compatibility, but B2C only sends a Cache-Control header. Is there anything I can do about this?

azure-ad-b2c
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

alfredorevilla-msft avatar image
0 Votes"
alfredorevilla-msft answered BruceHarrison-5147 commented

Hello @bruceharrison-5147, currently this is not possible. As workaround you might create a middleware that add's any custom header to the B2C response.

Please take a look to the following development resources:

Interactive signin (recommended):

  1. Use the Microsoft Authentication Library for JavaScript to work with Azure AD B2C

  2. Use MSAL.NET to sign in users with social identities

Non-interactive signin (daemon/service/application):

  1. MSAL Username/password (ROPC)

  2. Microsoft Authentication Library for Node (msal-node)

  3. Configure the ROPC flow in Azure AD B2C with MSAL.NET


Let us know if this answer was helpful to you or if you need additional assistance. If it was helpful, please remember to accept it so that others in the community with similar questions can more easily find a solution.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you have any examples of this? In my case, the client itself (pre-existing application) communicates directly with the B2C endpoint via the ./well-known/openid-configuration, so there isn't exactly anywhere to implement a middleware to attach additional headers. Is proxying the token endpoint a viable solution?

0 Votes 0 ·