Regard token to be invalid only when remote throws ForbiddenOperationException

This commit is contained in:
yushijinhun 2018-06-30 18:52:37 +08:00
parent c4db9c9e12
commit 9fa56a9cd4
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4

View File

@ -84,7 +84,10 @@ public class YggdrasilService {
requireEmpty(request(provider.getValidationURL(), createRequestWithCredentials(accessToken, clientToken)));
return true;
} catch (RemoteAuthenticationException e) {
return false;
if ("ForbiddenOperationException".equals(e.getRemoteName())) {
return false;
}
throw e;
}
}