use of org.wso2.carbon.identity.discovery.builders.OIDProviderResponseBuilder in project identity-inbound-auth-oauth by wso2-extensions.
the class OIDCDiscoveryEndpoint method getResponse.
private Response getResponse(HttpServletRequest request, String tenant) {
String response;
OIDCProcessor processor = EndpointUtil.getOIDCService();
try {
OIDProviderResponseBuilder responseBuilder = getOidProviderResponseBuilder();
response = responseBuilder.getOIDProviderConfigString(processor.getResponse(request, tenant));
} catch (OIDCDiscoveryEndPointException e) {
Response.ResponseBuilder errorResponse = Response.status(processor.handleError(e));
return errorResponse.entity(e.getMessage()).build();
} catch (ServerConfigurationException e) {
log.error("Server Configuration error occurred.", e);
Response.ResponseBuilder errorResponse = Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return errorResponse.entity("Error in reading configuration.").build();
}
Response.ResponseBuilder responseBuilder = Response.status(HttpServletResponse.SC_OK);
return responseBuilder.entity(response).build();
}
Aggregations