Retrieve OAuth2 or Personal Accesss Tokens for Visual Studio Team Services (visualstudio.com) accounts. Also provides secure storage for those secrets on different platforms.
MIT License
18
stars
20
forks
source link
OAuth2Authenticator.getOAuth2TokenPair() is unable to use refresh token #15
OAuth2Authenticator.getOAuth2TokenPair() is unable to use refresh token. Here is what happens and what we see:
When calling OAuth2Authenticator.getOAuth2TokenPair(), a token pair with an access token and a refresh token is returned. So far, so good.
After one hour, the access token expires and when calling OAuth2Authenticator.getOAuth2TokenPair() again, this method tries to validate the access token. In this case, VSTS will return a 203 status code.
OAuth2Authenticator.getOAuth2TokenPair() is unable to use refresh token. Here is what happens and what we see:
OAuth2Authenticator.getOAuth2TokenPair()
, a token pair with an access token and a refresh token is returned. So far, so good.OAuth2Authenticator.getOAuth2TokenPair()
again, this method tries to validate the access token. In this case, VSTS will return a 203 status code.IOException
to be thrown, which is not the case.NullPointerException
is thrown inHttpClientImpl
, because the stream seems to be nonexistent in this call.Net result:
NullPointerException
is never caught and bubbles up to the caller, making refresh tokens impossible to use.I have created a pull request that fixes this
NullPointerException
. If possible, can a new build of the library be created?/cc @DavidStaheli