Search in sources :

Example 1 with WebFingerResponseBuilder

use of org.wso2.carbon.identity.webfinger.builders.WebFingerResponseBuilder in project identity-inbound-auth-oauth by wso2-extensions.

the class WebFingerServlet method getOIDProviderIssuer.

public void getOIDProviderIssuer(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException {
    WebFingerProcessor processor = WebFingerServiceComponentHolder.getWebFingerProcessor();
    String response = "";
    try {
        WebFingerResponseBuilder webFingerResponseBuilder = new JSONResponseBuilder();
        response = webFingerResponseBuilder.getOIDProviderIssuerString(processor.getResponse(httpServletRequest));
    } catch (WebFingerEndpointException e) {
        httpServletResponse.setStatus(processor.handleError(e));
        return;
    } catch (ServerConfigurationException e) {
        log.error("Server Configuration error occurred.", e);
        httpServletResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        return;
    }
    httpServletResponse.setContentType(WebFingerConstants.RESPONSE_CONTENT_TYPE);
    PrintWriter out = httpServletResponse.getWriter();
    out.print(response);
}
Also used : ServerConfigurationException(org.wso2.carbon.base.ServerConfigurationException) WebFingerResponseBuilder(org.wso2.carbon.identity.webfinger.builders.WebFingerResponseBuilder) WebFingerProcessor(org.wso2.carbon.identity.webfinger.WebFingerProcessor) WebFingerEndpointException(org.wso2.carbon.identity.webfinger.WebFingerEndpointException) PrintWriter(java.io.PrintWriter)

Aggregations

PrintWriter (java.io.PrintWriter)1 ServerConfigurationException (org.wso2.carbon.base.ServerConfigurationException)1 WebFingerEndpointException (org.wso2.carbon.identity.webfinger.WebFingerEndpointException)1 WebFingerProcessor (org.wso2.carbon.identity.webfinger.WebFingerProcessor)1 WebFingerResponseBuilder (org.wso2.carbon.identity.webfinger.builders.WebFingerResponseBuilder)1