use of com.okta.oidc.net.request.IntrospectRequest in project okta-oidc-android by okta.
the class SyncSessionClientImplTest method introspectToken.
@Test
public void introspectToken() throws AuthorizationException, InterruptedException, OktaRepository.EncryptionException {
mEndPoint.enqueueIntrospectSuccess();
IntrospectRequest request = mSyncSessionClientImpl.introspectTokenRequest(ACCESS_TOKEN, TokenTypeHint.ACCESS_TOKEN, mOktaState.getProviderConfiguration());
IntrospectInfo response = request.executeRequest(mHttpClient);
assertTrue(response.isActive());
}
use of com.okta.oidc.net.request.IntrospectRequest in project okta-oidc-android by okta.
the class SyncSessionClientImpl method introspectToken.
@Override
public IntrospectInfo introspectToken(String token, String tokenType) throws AuthorizationException {
try {
IntrospectRequest request = introspectTokenRequest(token, tokenType, 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.IntrospectRequest in project okta-oidc-android by okta.
the class SyncSessionClientImplTest method introspectTokenFailure.
@Test
public void introspectTokenFailure() throws AuthorizationException, InterruptedException, OktaRepository.EncryptionException {
mExpectedEx.expect(AuthorizationException.class);
mEndPoint.enqueueReturnInvalidClient();
IntrospectRequest request = mSyncSessionClientImpl.introspectTokenRequest(ACCESS_TOKEN, TokenTypeHint.ACCESS_TOKEN, mOktaState.getProviderConfiguration());
IntrospectInfo response = request.executeRequest(mHttpClient);
assertNull(response);
}
Aggregations