use of org.wso2.carbon.identity.application.authentication.framework.JsFunctionRegistry in project identity-conditional-auth-functions by wso2-extensions.
the class UserStoreFunctionsServiceComponent method activate.
@Activate
protected void activate(ComponentContext ctxt) {
try {
UserStoreFunctions storeFunctions = new UserStoreFunctions();
JsFunctionRegistry jsFunctionRegistry = UserStoreFunctionsServiceHolder.getInstance().getJsFunctionRegistry();
jsFunctionRegistry.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "getUniqueUserWithClaimValues", (GetUserWithClaimValues) storeFunctions::getUniqueUserWithClaimValues);
} catch (Throwable e) {
LOG.error("Error occurred during conditional authentication user functions bundle activation. ", e);
}
}
use of org.wso2.carbon.identity.application.authentication.framework.JsFunctionRegistry in project identity-conditional-auth-functions by wso2-extensions.
the class HTTPFunctionsServiceComponent method deactivate.
@Deactivate
protected void deactivate(ComponentContext ctxt) {
JsFunctionRegistry jsFunctionRegistry = HTTPFunctionsServiceHolder.getInstance().getJsFunctionRegistry();
if (jsFunctionRegistry != null) {
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, FUNC_SET_COOKIE);
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, FUNC_GET_COOKIE_VALUE);
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, FUNC_HTTP_POST);
}
}
use of org.wso2.carbon.identity.application.authentication.framework.JsFunctionRegistry in project identity-conditional-auth-functions by wso2-extensions.
the class AnalyticsFunctionsServiceComponent method deactivate.
@Deactivate
protected void deactivate(ComponentContext ctxt) {
JsFunctionRegistry jsFunctionRegistry = AnalyticsFunctionsServiceHolder.getInstance().getJsFunctionRegistry();
if (jsFunctionRegistry != null) {
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, FUNC_CALL_SIDDHI);
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, FUNC_PUBLISH_SIDDHI);
}
}
use of org.wso2.carbon.identity.application.authentication.framework.JsFunctionRegistry in project identity-conditional-auth-functions by wso2-extensions.
the class AnalyticsFunctionsServiceComponent method activate.
@Activate
protected void activate(ComponentContext context) {
try {
JsFunctionRegistry jsFunctionRegistry = AnalyticsFunctionsServiceHolder.getInstance().getJsFunctionRegistry();
CallAnalyticsFunction callSiddhi = new CallAnalyticsFunctionImpl();
jsFunctionRegistry.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, FUNC_CALL_SIDDHI, callSiddhi);
PublishToAnalyticsFunction publishSiddhi = new PublishToAnalyticsFunctionImpl();
jsFunctionRegistry.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, FUNC_PUBLISH_SIDDHI, publishSiddhi);
BundleContext bundleContext = context.getBundleContext();
AnalyticsEngineConfigImpl analyticsFunctionConfig = new AnalyticsEngineConfigImpl();
bundleContext.registerService(IdentityConnectorConfig.class.getName(), analyticsFunctionConfig, null);
AnalyticsAxis2ConfigurationContextObserver observer = new AnalyticsAxis2ConfigurationContextObserver();
bundleContext.registerService(Axis2ConfigurationContextObserver.class.getName(), observer, null);
ServerConfigurationService config = AnalyticsFunctionsServiceHolder.getInstance().getServerConfigurationService();
String filePath = config.getFirstProperty("Security.TrustStore.Location");
String keyStoreType = config.getFirstProperty("Security.TrustStore.Type");
String password = config.getFirstProperty("Security.TrustStore.Password");
try (InputStream keyStoreStream = new FileInputStream(filePath)) {
// or "PKCS12"
KeyStore keyStore = KeyStore.getInstance(keyStoreType);
keyStore.load(keyStoreStream, password.toCharArray());
AnalyticsFunctionsServiceHolder.getInstance().setTrustStore(keyStore);
} catch (IOException | CertificateException | KeyStoreException | NoSuchAlgorithmException e) {
LOG.error("Error while loading truststore.", e);
}
} catch (Throwable e) {
LOG.error("Error while activating AnalyticsFunctionsServiceComponent");
}
}
use of org.wso2.carbon.identity.application.authentication.framework.JsFunctionRegistry in project identity-conditional-auth-functions by wso2-extensions.
the class UserFunctionsServiceComponent method deactivate.
@Deactivate
protected void deactivate(ComponentContext ctxt) {
JsFunctionRegistry jsFunctionRegistry = UserFunctionsServiceHolder.getInstance().getJsFunctionRegistry();
if (jsFunctionRegistry != null) {
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "hasRole");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "hasAnyOfTheRoles");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "isMemberOfAnyOfGroups");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "promptIdentifierForStep");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "checkSessionExistence");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "assignUserRoles");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "removeUserRoles");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "getAssociatedLocalUser");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "getUserSessions");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "terminateUserSession");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "doAssociationWithLocalUser");
jsFunctionRegistry.deRegister(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "isAnyOfTheRolesAssignedToUser");
}
}
Aggregations