use of com.okta.oidc.net.request.RevokeTokenRequest in project okta-oidc-android by okta.
the class SyncSessionClientImplTest method revokeTokenRequest.
@Test
public void revokeTokenRequest() throws AuthorizationException, InterruptedException, OktaRepository.EncryptionException {
mEndPoint.enqueueReturnSuccessEmptyBody();
RevokeTokenRequest request = mSyncSessionClientImpl.revokeTokenRequest("access_token", mOktaState.getProviderConfiguration());
boolean status = request.executeRequest(mHttpClient);
RecordedRequest recordedRequest = mEndPoint.takeRequest();
assertThat(recordedRequest.getPath(), equalTo("/revoke?client_id=CLIENT_ID&token=access_token"));
assertTrue(status);
}
use of com.okta.oidc.net.request.RevokeTokenRequest in project okta-oidc-android by okta.
the class SyncSessionClientImpl method revokeToken.
@Override
public Boolean revokeToken(String token) throws AuthorizationException {
try {
RevokeTokenRequest request = revokeTokenRequest(token, mOktaState.getProviderConfiguration());
mCurrentRequest.set(new WeakReference<>(request));
return request.executeRequest(mHttpClient);
} catch (OktaRepository.EncryptionException e) {
throw AuthorizationException.EncryptionErrors.byEncryptionException(e);
}
}
use of com.okta.oidc.net.request.RevokeTokenRequest in project okta-oidc-android by okta.
the class SyncSessionClientImplTest method revokeTokenRequestFailure.
@Test
public void revokeTokenRequestFailure() throws AuthorizationException, InterruptedException, AuthorizationException, OktaRepository.EncryptionException {
mExpectedEx.expect(AuthorizationException.class);
mEndPoint.enqueueReturnInvalidClient();
RevokeTokenRequest request = mSyncSessionClientImpl.revokeTokenRequest("access_token", mOktaState.getProviderConfiguration());
boolean status = request.executeRequest(mHttpClient);
RecordedRequest recordedRequest = mEndPoint.takeRequest();
assertFalse(status);
assertThat(recordedRequest.getPath(), equalTo("/revoke?client_id=CLIENT_ID&token=access_token"));
}
Aggregations