private OIDCProviderMetadata retrieveOidcProviderMetadata(final String discoveryUri) throws IOException, ParseException { final URL url = new URL(discoveryUri); final HTTPRequest httpRequest = new HTTPRequest(HTTPRequest.Method.GET, url); httpRequest.setConnectTimeout(oidcConnectTimeout); httpRequest.setReadTimeout(oidcReadTimeout); final HTTPResponse httpResponse = httpRequest.send(); if (httpResponse.getStatusCode() != 200) { throw new IOException("Unable to download OpenId Connect Provider metadata from " + url + ": Status code " + httpResponse.getStatusCode()); } final JSONObject jsonObject = httpResponse.getContentAsJSONObject(); return OIDCProviderMetadata.parse(jsonObject); }
/** * * @param httpResponse * @return * @throws ParseException */ static AdalAccessTokenResponse parseHttpResponse( final HTTPResponse httpResponse) throws ParseException { httpResponse.ensureStatusCode(HTTPResponse.SC_OK); final JSONObject jsonObject = httpResponse.getContentAsJSONObject(); return parseJsonObject(jsonObject); }
/** * * @param httpResponse * @return * @throws ParseException */ static AdalAccessTokenResponse parseHttpResponse( final HTTPResponse httpResponse) throws ParseException { httpResponse.ensureStatusCode(HTTPResponse.SC_OK); final JSONObject jsonObject = httpResponse.getContentAsJSONObject(); return parseJsonObject(jsonObject); }
/** * * @param httpResponse * @return * @throws ParseException */ static AdalAccessTokenResponse parseHttpResponse( final HTTPResponse httpResponse) throws ParseException { httpResponse.ensureStatusCode(HTTPResponse.SC_OK); final JSONObject jsonObject = httpResponse.getContentAsJSONObject(); return parseJsonObject(jsonObject); }
private OIDCProviderMetadata retrieveOidcProviderMetadata(final String discoveryUri) throws IOException, ParseException { final URL url = new URL(discoveryUri); final HTTPRequest httpRequest = new HTTPRequest(HTTPRequest.Method.GET, url); httpRequest.setConnectTimeout(oidcConnectTimeout); httpRequest.setReadTimeout(oidcReadTimeout); final HTTPResponse httpResponse = httpRequest.send(); if (httpResponse.getStatusCode() != 200) { throw new IOException("Unable to download OpenId Connect Provider metadata from " + url + ": Status code " + httpResponse.getStatusCode()); } final JSONObject jsonObject = httpResponse.getContentAsJSONObject(); return OIDCProviderMetadata.parse(jsonObject); }