/** * Executes the call to the REST Service requesting the token revocation and processes the response. * * @param clientId The client identifier. * @param clientSecret The client secret. * @param token The token that the client wants to get revoked. * @param tokenTypeHint A hint about the type of the token submitted for revocation. * @return The token revocation response. */ public TokenRevocationResponse execTokenRevocation(String clientId, String clientSecret, String token, TokenTypeHint tokenTypeHint) { setRequest(new TokenRevocationRequest()); getRequest().setToken(token); getRequest().setTokenTypeHint(tokenTypeHint); getRequest().setAuthUsername(clientId); getRequest().setAuthPassword(clientSecret); return exec(); }
tokenRevocationRequest.setToken("INVALID_ACCESS_TOKEN"); tokenRevocationRequest.setTokenTypeHint(TokenTypeHint.ACCESS_TOKEN); tokenRevocationRequest.setAuthUsername(clientId); tokenRevocationRequest.setAuthPassword(clientSecret);
tokenRevocationRequest.setToken(refreshToken); tokenRevocationRequest.setTokenTypeHint(TokenTypeHint.REFRESH_TOKEN); tokenRevocationRequest.setAuthUsername(clientId); tokenRevocationRequest.setAuthPassword("INVALID_CLIENT_SECRET");
tokenRevocationRequest.setAuthUsername(clientId); tokenRevocationRequest.setAuthPassword(clientSecret);
tokenRevocationRequest2.setToken(accessToken); tokenRevocationRequest2.setTokenTypeHint(TokenTypeHint.ACCESS_TOKEN); tokenRevocationRequest2.setAuthUsername(clientId); tokenRevocationRequest2.setAuthPassword(clientSecret);
tokenRevocationRequest1.setAuthUsername(clientId); tokenRevocationRequest1.setAuthPassword(clientSecret); tokenRevocationRequest2.setAuthUsername(clientId); tokenRevocationRequest2.setAuthPassword(clientSecret);
tokenRevocationRequest1.setToken(refreshToken2); tokenRevocationRequest1.setTokenTypeHint(TokenTypeHint.REFRESH_TOKEN); tokenRevocationRequest1.setAuthUsername(clientId); tokenRevocationRequest1.setAuthPassword(clientSecret); tokenRevocationRequest2.setToken(accessToken2); tokenRevocationRequest2.setTokenTypeHint(TokenTypeHint.ACCESS_TOKEN); tokenRevocationRequest2.setAuthUsername(clientId); tokenRevocationRequest2.setAuthPassword(clientSecret);
tokenRevocationRequest1.setToken(refreshToken); tokenRevocationRequest1.setTokenTypeHint(TokenTypeHint.REFRESH_TOKEN); tokenRevocationRequest1.setAuthUsername(clientId); tokenRevocationRequest1.setAuthPassword(clientSecret); tokenRevocationRequest2.setToken(accessToken); tokenRevocationRequest2.setTokenTypeHint(TokenTypeHint.ACCESS_TOKEN); tokenRevocationRequest2.setAuthUsername(clientId); tokenRevocationRequest2.setAuthPassword(clientSecret);