public ServiceClient createServiceClient(URI host) { return new ServiceClient(host, getSSLConfiguration()); }
/** * Create a basic {@link ServiceClient} to get the keys from the well known page. If you require a special * setup (e.g. your own SSL certs), you will need to create your own ServiceClient and supply that in the * related call getJSONWebKeys(ServiceClient, String wellKnown). * @param wellKnown * @return */ public static JSONWebKeys getJsonWebKeys(String wellKnown) { if(wellKnown == null || wellKnown.isEmpty()){ throw new GeneralException("Error: missing well known URI. Cannot get keys"); } ServiceClient serviceClient = new ServiceClient(URI.create(wellKnown)); return getJsonWebKeys(serviceClient, wellKnown); }
wellKnown = inputLine.getArg(1); try { keys = JWTUtil.getJsonWebKeys(new ServiceClient(URI.create("https://scitokens.org")), wellKnown); }catch(Throwable t){ t.printStackTrace();