use of org.wso2.carbon.identity.webfinger.servlet.WebFingerServlet in project identity-inbound-auth-oauth by wso2-extensions.
the class WebFingerServiceComponent method activate.
protected void activate(ComponentContext context) {
try {
BundleContext bundleContext = context.getBundleContext();
WebFingerProcessor webFingerProcessor = DefaultWebFingerProcessor.getInstance();
bundleContext.registerService(WebFingerProcessor.class.getName(), webFingerProcessor, null);
WebFingerServiceComponentHolder.setWebFingerProcessor(webFingerProcessor);
if (log.isDebugEnabled()) {
log.debug("OpenID WebFinger bundle is activated.");
}
// Register OpenID Connect WebFinger servlet
HttpService httpService = WebFingerServiceComponentHolder.getHttpService();
Servlet webFingerServlet = new ContextPathServletAdaptor(new WebFingerServlet(), "/.well-known/webfinger");
try {
httpService.registerServlet("/.well-known/webfinger", webFingerServlet, null, null);
} catch (Exception e) {
String errMsg = "Error when registering Web Finger Servlet via the HttpService.";
log.error(errMsg, e);
throw new RuntimeException(errMsg, e);
}
} catch (Throwable e) {
log.error("Error while activating the WebFingerServiceComponent", e);
}
}
Aggregations