I need to connect to an api that requires a bearer token in the header for authentication.
This token should be generated with a jwk.
Example to request a token (there are public available examples from the service, so no secrets from my side):
POST /op/v1/token HTTP/1.1
Host: authenticatie.vlaanderen.be
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&
audience=8ed36a78-8443-11ec-b334-83e86b606670&
audience=9e6a512c-8443-11ec-ae2c-8700eb2a0cde&
scope=org_api_appread%20org_api_appwrite&
client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer&
client_assertion=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIyODM1ODgxNC01YzIwLTRjMTMtYmJmZi1kYjVkZDhjNGFlOTMiLCJzdWIiOiIyODM1ODgxNC01YzIwLTRjMTMtYmJmZi1kYjVkZDhjNGFlOTMiLCJhdWQiOiJodHRwczovL2F1dGhlbnRpY2F0aWUudmxhYW5kZXJlbi5iZS9vcCIsImV4cCI6MTU5MjIwODA2MCwianRpIjoiRGt6bmpzdTQzZHprZDN6amQ1IiwiaWF0IjoxNTkyMjA4MDAwfQ.3dPodaVhJ2d3cXWn0v2YGeZqs5XScJF2lm4MaweDnf4
the client assertion is a jwt that contains the following:
{
"iss": "28358814-5c20-4c13-bbff-db5dd8c4ae93",
"sub": "28358814-5c20-4c13-bbff-db5dd8c4ae93",
"aud": "https://authenticatie.vlaanderen.be/op",
"exp": 1592208060,
"jti": "Dkznjsu43dzkd3zjd5",
"iat": 1592208000
}
The client assertion is an encrypted string where a private key (a pem file) is used to encode the jwt.
Is there a way this can be achieved in FME? Currently this is done in an old python script so looking for a way to either achieve this in FME or looking into upgrading the python script.
(used python libs are pyjwt & cryptography)