Implement refresh token mechanism for all IDPs
Created by: kopancek
As part of incident https://sourcegraph.slack.com/archives/C03GQKP2NJF we have implemented a mechanism to refresh oauth tokens for gitlab identity provider. This is a ticking time bomb for the other identity providers as well as we did not implement refreshing tokens in any of the other providers. This issue was created to track work on longer term fix - implementing the refresh token mechanism for all the other providers and making sure the long-term solution is aligned across the code base.
We should take a look at how refreshing of an oauth token works: https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/
This would cover the following IDPs:
- Github
- Gitlab
- Generic Oauth
- Generic OpenIDConnect
We need to check if anything needs to be done for SAML