title: Any idea how to implement a custom AuthenticationProvider for a Visual Studio Code extension?
body: <p>I'm trying to implement custom OAuth (with refresh token) to an extension for Visual Studio Code but I'm having a hard time trying to understand how the AuthenticationProvider works and how a custom one needs to be implemented.</p>
  <p>I know we have the <a href="https://github.com/microsoft/vscode/tree/main/extensions/github-authentication" rel="nofollow noreferrer">https://github.com/microsoft/vscode/tree/main/extensions/github-authentication</a> example but still having trouble how something custom should be implemented.</p>
  <p>For example <code>createSession</code> function should do the whole authentication process and return a session. But how would you trigger a browser redirect to the OAuth2 endpoint, then capture the callback, get the token, etc in same function? How would you do all these external actions inside this single function?</p>
  <p>Anyone has a better understanding of how this is implemented inside VSC and how does it work?</p>