Hi Laurent,
Glad to hear a reply from a local colleague !
You are right saying that the overhead of calling STS with LocalSTSClient shouldn't be an issue.
I wanted to avoid creating additional STS transformations because it's an additional element that needs to be updated every time a certificate involved has to be renewed (in addition to having to maintain and sync between environments).
As I was unable to find a way to do change the client_id directly in the OAuth Pre/PostToken mapping rule, I finally opted for an alternative solution that fits nicely with the initial requirements : implementing it in an Authentication Policy.
This new AuthenticationPolicy will only be made available on the reverse proxies concerned and its implementation is quite straight forward :
- Look for a jwt token in the incoming request
- Call a STS transfo for validating the JWT (configured with a jwks to simplify certificate management)
- Perform additional manual validations on the JWT (in particular "aud" claim)
- Populate the stsuu with the identification data, so a web session is created
In the end, it's is not exactly what I aimed for initially, which was exchanging an oauth token from app A to a token for app B, but it fullfills our current need, which is "from an oauth app A I want to open a webview to website B".
Best regards and happy new year!
------------------------------
André Leruitte
Security Architect
POST Luxembourg
Luxembourg
------------------------------
Original Message:
Sent: Fri January 03, 2025 05:45 AM
From: Laurent LA Asselborn
Subject: Implementing oauth token_exchange flow
Hi André,
I'm also implementing a token exchange mechanism right now. I'm only just discovering this functionnality so I'm in no way an expert.
We are using JWT tokens, which allow you much more freedom. And with the LocalSTSClient the overhead shouldn't be to big.
I have now also played around a bit with opaque tokens but I've also not found a way to change the client_id of the generated token.
The best approach will probably be to use JWT tokens.
What is your reason for wanting to avoid calling an STS? Just the overhead or are there other considerations?
Kind regards from Luxembourg (CtiE)
------------------------------
Laurent LA Asselborn
------------------------------