diff --git a/bundles/org.openhab.core.auth.oauth2client/src/main/java/org/openhab/core/auth/oauth2client/internal/OAuthClientServiceImpl.java b/bundles/org.openhab.core.auth.oauth2client/src/main/java/org/openhab/core/auth/oauth2client/internal/OAuthClientServiceImpl.java index 767dc56e4c..bb5d434cae 100644 --- a/bundles/org.openhab.core.auth.oauth2client/src/main/java/org/openhab/core/auth/oauth2client/internal/OAuthClientServiceImpl.java +++ b/bundles/org.openhab.core.auth.oauth2client/src/main/java/org/openhab/core/auth/oauth2client/internal/OAuthClientServiceImpl.java @@ -291,7 +291,7 @@ public class OAuthClientServiceImpl implements OAuthClientService { } @Override - public AccessTokenResponse refreshToken() throws OAuthException, IOException, OAuthResponseException { + public synchronized AccessTokenResponse refreshToken() throws OAuthException, IOException, OAuthResponseException { if (isClosed()) { throw new OAuthException(EXCEPTION_MESSAGE_CLOSED); } @@ -333,7 +333,7 @@ public class OAuthClientServiceImpl implements OAuthClientService { } @Override - public @Nullable AccessTokenResponse getAccessTokenResponse() + public synchronized @Nullable AccessTokenResponse getAccessTokenResponse() throws OAuthException, IOException, OAuthResponseException { if (isClosed()) { throw new OAuthException(EXCEPTION_MESSAGE_CLOSED);