@Test void testLoadTokenURL() throws IOException { String openIdIssuer = "https: String tokenEndpointResponse = "{\"issuer\": \"https: " \"token_endpoint\": \"https: mockOkHttpClient(HttpURLConnection.HTTP_OK, tokenEndpointResponse); Map<String, Object> discoveryDocumentMap = OpenIDConnectionUtils.getOIDCDiscoveryDocumentAsMap(mockClient, openIdIssuer); assertNotNull(discoveryDocumentMap); assertEquals("https: }
static Map<String, Object> getOIDCDiscoveryDocumentAsMap(OkHttpClient client, String issuer) { try (Response response = client.newCall(getDiscoveryDocumentHttpRequest(issuer)).execute()) { if (response.isSuccessful() && response.body() != null) { return convertJsonStringToMap(response.body().string()); } else { String responseBody = response.body() != null ? response.body().string() : null; LOGGER.warn("oidc: failed to query metadata endpoint: {} {}", response.code(), responseBody); } } catch (IOException e) { LOGGER.warn("Could not refresh OIDC token, failure in getting refresh URL", e); } return Collections.emptyMap(); }
OpenIDConnectionUtils { static Map<String, Object> getOIDCDiscoveryDocumentAsMap(OkHttpClient client, String issuer) { try (Response response = client.newCall(getDiscoveryDocumentHttpRequest(issuer)).execute()) { if (response.isSuccessful() && response.body() != null) { return convertJsonStringToMap(response.body().string()); } else { String responseBody = response.body() != null ? response.body().string() : null; LOGGER.warn("oidc: failed to query metadata endpoint: {} {}", response.code(), responseBody); } } catch (IOException e) { LOGGER.warn("Could not refresh OIDC token, failure in getting refresh URL", e); } return Collections.emptyMap(); } }
OpenIDConnectionUtils { static Map<String, Object> getOIDCDiscoveryDocumentAsMap(OkHttpClient client, String issuer) { try (Response response = client.newCall(getDiscoveryDocumentHttpRequest(issuer)).execute()) { if (response.isSuccessful() && response.body() != null) { return convertJsonStringToMap(response.body().string()); } else { String responseBody = response.body() != null ? response.body().string() : null; LOGGER.warn("oidc: failed to query metadata endpoint: {} {}", response.code(), responseBody); } } catch (IOException e) { LOGGER.warn("Could not refresh OIDC token, failure in getting refresh URL", e); } return Collections.emptyMap(); } private  OpenIDConnectionUtils(); }
OpenIDConnectionUtils { static Map<String, Object> getOIDCDiscoveryDocumentAsMap(OkHttpClient client, String issuer) { try (Response response = client.newCall(getDiscoveryDocumentHttpRequest(issuer)).execute()) { if (response.isSuccessful() && response.body() != null) { return convertJsonStringToMap(response.body().string()); } else { String responseBody = response.body() != null ? response.body().string() : null; LOGGER.warn("oidc: failed to query metadata endpoint: {} {}", response.code(), responseBody); } } catch (IOException e) { LOGGER.warn("Could not refresh OIDC token, failure in getting refresh URL", e); } return Collections.emptyMap(); } private  OpenIDConnectionUtils(); static String resolveOIDCTokenFromAuthConfig(Map<String, String> currentAuthProviderConfig); }
OpenIDConnectionUtils { static Map<String, Object> getOIDCDiscoveryDocumentAsMap(OkHttpClient client, String issuer) { try (Response response = client.newCall(getDiscoveryDocumentHttpRequest(issuer)).execute()) { if (response.isSuccessful() && response.body() != null) { return convertJsonStringToMap(response.body().string()); } else { String responseBody = response.body() != null ? response.body().string() : null; LOGGER.warn("oidc: failed to query metadata endpoint: {} {}", response.code(), responseBody); } } catch (IOException e) { LOGGER.warn("Could not refresh OIDC token, failure in getting refresh URL", e); } return Collections.emptyMap(); } private  OpenIDConnectionUtils(); static String resolveOIDCTokenFromAuthConfig(Map<String, String> currentAuthProviderConfig); static final String ID_TOKEN_KUBECONFIG; static final String ISSUER_KUBECONFIG; static final String REFRESH_TOKEN_KUBECONFIG; static final String REFRESH_TOKEN_PARAM; static final String GRANT_TYPE_PARAM; static final String CLIENT_ID_PARAM; static final String CLIENT_SECRET_PARAM; static final String ID_TOKEN_PARAM; static final String ACCESS_TOKEN_PARAM; static final String CLIENT_ID_KUBECONFIG; static final String CLIENT_SECRET_KUBECONFIG; static final String IDP_CERT_DATA; static final String TOKEN_ENDPOINT_PARAM; static final String WELL_KNOWN_OPENID_CONFIGURATION; static final String GRANT_TYPE_REFRESH_TOKEN; }