I'm developing a source connector for Fortnox, and are using an OAuth Authentication Code Grant type for authentication.
I need to supply ClientId ClientSecret and RefreshToken to configure this connector.
My problem is the following:
Whenever the refresh token is used to get a new access token a new refresh token is issued and the old one is invalidated, (see
https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics#section-4.14.2 under Refresh Token Rotation)
The question I have is, if there is any possibility of storing state in the source connector, or somehow update the config to always store the most current refreshtoken in use.
I'm thinking that storing the current refresh token on the connection between source and destination is not a good solution in case the same configured source is used in two different connections. Also I have some concerns around the locking and updating this variable to make sure that the refresh-token-chain never get two concurrent updates which could potentially invalidate the refresh token chain.