Search in sources :

Example 11 with TokenRequest

use of com.okta.oidc.net.request.TokenRequest in project okta-oidc-android by okta.

the class OktaIdTokenTest method validateIssuedAtTimeoutWithEmptyValidator.

@Test
public void validateIssuedAtTimeoutWithEmptyValidator() throws AuthorizationException {
    String jws = TestValues.getJwtIssuedAtTimeout(CUSTOM_URL, CUSTOM_NONCE, mConfig.getClientId());
    OktaIdToken idToken = OktaIdToken.parseIdToken(jws);
    String verifier = CodeVerifierUtil.generateRandomCodeVerifier();
    TokenRequest tokenRequest = TestValues.getTokenRequest(mConfig, getAuthorizeRequest(mConfig, verifier), getAuthorizeResponse("state", "code"), mConfiguration);
    OktaIdToken.Validator validator = mock(OktaIdToken.Validator.class);
    idToken.validate(tokenRequest, validator);
    verify(validator).validate(idToken);
}
Also used : TokenRequest(com.okta.oidc.net.request.TokenRequest) Test(org.junit.Test)

Aggregations

TokenRequest (com.okta.oidc.net.request.TokenRequest)11 Test (org.junit.Test)9 TokenResponse (com.okta.oidc.net.response.TokenResponse)4 AuthorizeResponse (com.okta.oidc.net.response.web.AuthorizeResponse)4 AuthorizeRequest (com.okta.oidc.net.request.web.AuthorizeRequest)3 AuthorizationException (com.okta.oidc.util.AuthorizationException)3 ProviderConfiguration (com.okta.oidc.net.request.ProviderConfiguration)2 RevokeTokenRequest (com.okta.oidc.net.request.RevokeTokenRequest)2 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)2 NonNull (androidx.annotation.NonNull)1 WorkerThread (androidx.annotation.WorkerThread)1 NativeAuthorizeRequest (com.okta.oidc.net.request.NativeAuthorizeRequest)1 WebRequest (com.okta.oidc.net.request.web.WebRequest)1 OktaRepository (com.okta.oidc.storage.OktaRepository)1 IOException (java.io.IOException)1