Access to JWT in CustomOIDCProtocolMapper

Hi,

I am trying to use create a custom OIDCProtocolMapper extending AbstractOIDCProtocolMapper. This custom implementation calls another API (Custom External API), which provides some user data from a database, and this data is enriched in the token that is returned back to the client.

When I call custom External API, I am currently not passing any Authorization header, but I would like to. How can I get the JWT and add authorization header before I invoke the custom External API?

I see that the transformAccessToken method has accessToken as a parameter, but not sure how I can build a valid Authorization Header from that.

Any help is greatly appreciated.