use of org.wso2.carbon.identity.oidc.session.servlet.OIDCSessionIFrameServlet in project identity-inbound-auth-oauth by wso2-extensions.
the class OIDCSessionManagementComponent method activate.
protected void activate(ComponentContext context) {
HttpService httpService = OIDCSessionManagementComponentServiceHolder.getHttpService();
// Register Session IFrame Servlet
Servlet sessionIFrameServlet = new ContextPathServletAdaptor(new OIDCSessionIFrameServlet(), OIDCSessionConstants.OIDCEndpoints.OIDC_SESSION_IFRAME_ENDPOINT);
try {
httpService.registerServlet(OIDCSessionConstants.OIDCEndpoints.OIDC_SESSION_IFRAME_ENDPOINT, sessionIFrameServlet, null, null);
} catch (Exception e) {
String msg = "Error when registering OIDC Session IFrame Servlet via the HttpService.";
log.error(msg, e);
throw new RuntimeException(msg, e);
}
Servlet logoutServlet = new ContextPathServletAdaptor(new OIDCLogoutServlet(), OIDCSessionConstants.OIDCEndpoints.OIDC_LOGOUT_ENDPOINT);
try {
httpService.registerServlet(OIDCSessionConstants.OIDCEndpoints.OIDC_LOGOUT_ENDPOINT, logoutServlet, null, null);
} catch (Exception e) {
String msg = "Error when registering OIDC Logout Servlet via the HttpService.";
log.error(msg, e);
throw new RuntimeException(msg, e);
}
if (log.isDebugEnabled()) {
log.info("OIDC Session Management bundle is activated");
}
ClaimProviderImpl claimProviderImpl = new ClaimProviderImpl();
try {
context.getBundleContext().registerService(ClaimProvider.class.getName(), claimProviderImpl, null);
} catch (Exception e) {
String msg = "Error when registering ClaimProvider service";
log.error(msg, e);
throw new RuntimeException(msg, e);
}
if (log.isDebugEnabled()) {
log.debug("ClaimProvider bundle is activated");
}
try {
context.getBundleContext().registerService(AbstractEventHandler.class.getName(), new OIDCLogoutEventHandler(), null);
} catch (Exception e) {
String msg = "Error when registering OIDCLogoutEventHandler.";
log.error(msg, e);
throw new RuntimeException(msg, e);
}
context.getBundleContext().registerService(SessionContextMgtListener.class.getName(), new OIDCInboundSessionContextMgtListener(), null);
}
Aggregations