57 final HttpServletRequest httpRequest = request;
58 final HttpServletResponse httpResponse = response;
60 httpResponse.setContentType(
"application/jrd+json");
61 PrintWriter out = httpResponse.getWriter();
63 String resource = httpRequest.getParameter(RESOURCE);
64 String rel = httpRequest.getParameter(REL);
66 log.debug(
"Attempting to request OpenID Connect Discovery: " + resource +
", " + rel +
", Is Secure = " + httpRequest.isSecure());
69 if (OpenIdConnectDiscoveryParamsValidator.validateParams(resource, rel)) {
70 if (rel == null || rel.equals(REL_VALUE)) {
71 JSONObject jsonObj =
new JSONObject();
72 jsonObj.put(SUBJECT, resource);
74 JSONArray linksJsonArray =
new JSONArray();
75 JSONObject linkJsonObject =
new JSONObject();
76 linkJsonObject.put(REL, REL_VALUE);
79 linksJsonArray.put(linkJsonObject);
80 jsonObj.put(LINKS, linksJsonArray);
82 out.println(jsonObj.toString(4).replace(
"\\/",
"/"));
85 }
catch (JSONException e) {
86 log.error(e.getMessage(), e);
AppConfiguration appConfiguration
Definition: WebFinger.java:45
String getIssuer()
Definition: AppConfiguration.java:274
Logger log
Definition: WebFinger.java:42