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,8 +84,11 @@ public class YggdrasilService {
requireEmpty(request(provider.getValidationURL(), createRequestWithCredentials(accessToken, clientToken))); requireEmpty(request(provider.getValidationURL(), createRequestWithCredentials(accessToken, clientToken)));
return true; return true;
} catch (RemoteAuthenticationException e) { } catch (RemoteAuthenticationException e) {
if ("ForbiddenOperationException".equals(e.getRemoteName())) {
return false; return false;
} }
throw e;
}
} }
public void invalidate(String accessToken) throws AuthenticationException { public void invalidate(String accessToken) throws AuthenticationException {