You do not need to update this login. Create a timestamp when you receive a login from a third-party API. Then pass it to the end for each request.
On the back of each call, from the front end check timestamp, if it has expired, do not make regular API calls, but first get a new login, then make the requested calls.
As an answer to every external call, also return login information, so that before updating the user receives new credentials.
If the credentials are wide applications, then the front end shouldn't know about them at all. Just save the credentials in some kind of store (SQL DB, store of key values, etc.) And, if necessary, perform an automatic renewal.
source share