use of com.okta.oidc.OIDCConfig in project okta-oidc-android by okta.
the class HttpClientImplTest method setUp.
@Before
public void setUp() throws Exception {
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
OIDCConfig config = TestValues.getConfigWithUrl(url);
ProviderConfiguration providerConfiguration = TestValues.getProviderConfiguration(url);
TokenResponse tokenResponse = new Gson().fromJson(JsonStrings.TOKEN_RESPONSE, TokenResponse.class);
mHttpClient = new HttpClientImpl();
mRequest = HttpRequestBuilder.newAuthorizedRequest().uri(Uri.parse(mEndPoint.getUrl())).httpRequestMethod(ConnectionParameters.RequestMethod.POST).config(config).providerConfiguration(providerConfiguration).tokenResponse(tokenResponse).createRequest();
}
use of com.okta.oidc.OIDCConfig in project okta-oidc-android by okta.
the class ConfigurationRequestTest method setUp.
@Before
public void setUp() throws Exception {
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
OIDCConfig config = TestValues.getConfigWithUrl(url);
mRequest = HttpRequestBuilder.newConfigurationRequest().config(config).createRequest();
mClientFactory = new HttpClientFactory();
mClientFactory.setClientType(mClientType);
mHttpClient = mClientFactory.build();
OIDCConfig configOAuth2 = TestValues.getConfigWithUrl(url + "/oauth2/default/" + WELL_KNOWN_OAUTH);
mRequestOAuth2 = HttpRequestBuilder.newConfigurationRequest().config(configOAuth2).createRequest();
mCallbackExecutor = Executors.newSingleThreadExecutor();
}
use of com.okta.oidc.OIDCConfig in project okta-oidc-android by okta.
the class IntrospectRequestTest method setUp.
@Before
public void setUp() throws Exception {
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
OIDCConfig config = TestValues.getConfigWithUrl(url);
mProviderConfig = getProviderConfiguration(url);
mRequest = TestValues.getIntrospectTokenRequest(config, ACCESS_TOKEN, TokenTypeHint.ACCESS_TOKEN, mProviderConfig);
mClientFactory = new HttpClientFactory();
mClientFactory.setClientType(mClientType);
mHttpClient = mClientFactory.build();
}
use of com.okta.oidc.OIDCConfig in project okta-oidc-android by okta.
the class RevokeTokenRequestTest method setUp.
@Before
public void setUp() throws Exception {
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
OIDCConfig config = TestValues.getConfigWithUrl(url);
mProviderConfig = getProviderConfiguration(url);
mRequest = TestValues.getRevokeTokenRequest(config, ACCESS_TOKEN, mProviderConfig);
mClientFactory = new HttpClientFactory();
mClientFactory.setClientType(mClientType);
mHttpClient = mClientFactory.build();
}
use of com.okta.oidc.OIDCConfig in project okta-oidc-android by okta.
the class SyncSessionClientImplTest method userProfileRequestOAuth2.
@Test
public void userProfileRequestOAuth2() throws AuthorizationException, OktaRepository.EncryptionException {
mExpectedEx.expect(AuthorizationException.class);
// create sessionclient from oauth2 resource
OIDCConfig oauth2Config = TestValues.getConfigWithUrl(mEndPoint.getUrl() + "/oauth2/default/");
SyncWebAuthClient syncWebAuthClient = new Okta.SyncWebAuthBuilder().withConfig(oauth2Config).withOktaHttpClient(mHttpClient).withContext(mContext).withStorage(new SharedPreferenceStorage(mContext, "oauth2prefs")).withEncryptionManager(new EncryptionManagerStub()).create();
SyncSessionClientImpl sessionClient = (SyncSessionClientImpl) syncWebAuthClient.getSessionClient();
AuthorizedRequest request = sessionClient.userProfileRequest(mOktaState.getProviderConfiguration(), mOktaState.getTokenResponse());
request.executeRequest(mHttpClient);
}
Aggregations