/** * Revoke access or refresh token * @param token_type - A String containing the type of token to revoke. Should be either "access_token" or "refresh_token". * @param callback - The callback function returning the results. * @return */ public io.vertx.rxjava.ext.auth.oauth2.AccessToken revoke(String token_type, Handler<AsyncResult<Void>> callback) { delegate.revoke(token_type, callback); return this; }
/** * Revoke access or refresh token * @param token_type - A String containing the type of token to revoke. Should be either "access_token" or "refresh_token". * @param callback - The callback function returning the results. * @return */ public io.vertx.rxjava.ext.auth.oauth2.AccessToken revoke(String token_type, Handler<AsyncResult<Void>> callback) { delegate.revoke(token_type, callback); return this; }
@Test public void shouldRevokeAToken() { config = oauthConfig; oauth2.authenticate(tokenConfig, res -> { if (res.failed()) { fail(res.cause().getMessage()); } else { AccessToken token = (AccessToken) res.result(); // refresh the token config = revokeConfig; token.revoke("refresh_token", v -> { if (v.failed()) { fail(v.cause().getMessage()); } else { testComplete(); } }); } }); await(); } }