I have recently implemented a custom auth plugin provider in hopes of getting away from making a token call with every request OR having to manage the token myself.
I am using the Oauth 2.0 client credentials flow.
However, our API gateway is returning a 403 forbidden when the access token expires after one hour.
Unbeknownst to me, the refresh method of the custom auth provider plugin class is ONLY invoked when you receive a 401.
I am looking for a way to still utilize named credentials + auth provider + custom auth provider plugin to manage the tokens, but manually invoke the refresh method if I get a 403. I suppose I could generate a
Map<String,String> and simulate the
config by querying the metadata, but I'm wondering if there is a more direct way that I am not able to find.