prevent concurrent token read / refresh (#4686)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>pull/4688/head
parent
0f354e63f3
commit
1960646a6d
|
@ -291,7 +291,7 @@ public class OAuthClientServiceImpl implements OAuthClientService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AccessTokenResponse refreshToken() throws OAuthException, IOException, OAuthResponseException {
|
public synchronized AccessTokenResponse refreshToken() throws OAuthException, IOException, OAuthResponseException {
|
||||||
if (isClosed()) {
|
if (isClosed()) {
|
||||||
throw new OAuthException(EXCEPTION_MESSAGE_CLOSED);
|
throw new OAuthException(EXCEPTION_MESSAGE_CLOSED);
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ public class OAuthClientServiceImpl implements OAuthClientService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable AccessTokenResponse getAccessTokenResponse()
|
public synchronized @Nullable AccessTokenResponse getAccessTokenResponse()
|
||||||
throws OAuthException, IOException, OAuthResponseException {
|
throws OAuthException, IOException, OAuthResponseException {
|
||||||
if (isClosed()) {
|
if (isClosed()) {
|
||||||
throw new OAuthException(EXCEPTION_MESSAGE_CLOSED);
|
throw new OAuthException(EXCEPTION_MESSAGE_CLOSED);
|
||||||
|
|
Loading…
Reference in New Issue