use of org.wso2.carbon.apimgt.tokenmgt.listeners.KeyManagerUserOperationListener in project carbon-apimgt by wso2.
the class APITokenMgtServiceComponent method activate.
@Activate
protected void activate(ComponentContext ctxt) {
try {
TokenMgtDataHolder.initData();
listener = new KeyManagerUserOperationListener();
serviceRegistration = ctxt.getBundleContext().registerService(UserOperationEventListener.class.getName(), listener, null);
log.debug("Key Manager User Operation Listener is enabled.");
APIManagerConfigurationService configurationService = ServiceReferenceHolder.getInstance().getAPIManagerConfigurationService();
boolean accessTokenBindingEnable;
String firstProperty = configurationService.getAPIManagerConfiguration().getFirstProperty(APIConstants.AccessTokenBinding.ACCESS_TOKEN_BINDING_ENABLED);
if (firstProperty != null) {
accessTokenBindingEnable = Boolean.parseBoolean(firstProperty);
} else {
accessTokenBindingEnable = false;
}
if (!accessTokenBindingEnable) {
// registering logout token revoke listener
try {
SessionDataPublisherImpl dataPublisher = new SessionDataPublisherImpl();
ctxt.getBundleContext().registerService(AuthenticationDataPublisher.class.getName(), dataPublisher, null);
log.debug("SessionDataPublisherImpl bundle is activated");
} catch (Throwable e) {
log.error("SessionDataPublisherImpl bundle activation Failed", e);
}
}
} catch (Exception e) {
log.error("Failed to initialize key management service.", e);
}
}
Aggregations