Examples of SecurityConfigAdmin


Examples of org.wso2.carbon.security.config.SecurityConfigAdmin

            ConfigurationContext mainConfigCtx = configContextService.getServerConfigContext();
            AxisConfiguration mainAxisConfig = mainConfigCtx.getAxisConfiguration();
            BundleContext bundleCtx = ctxt.getBundleContext();          
            mainAxisConfig.engageModule(POX_SECURITY_MODULE);
            bundleCtx.registerService(SecurityConfigAdmin.class.getName(),
                                      new SecurityConfigAdmin(mainAxisConfig,
                                                              registryService.getConfigSystemRegistry(),
                                                              null),
                                      null);
            bundleCtx.registerService(Axis2ConfigurationContextObserver.class.getName(),
                                      new SecurityAxis2ConfigurationContextObserver(),
View Full Code Here

Examples of org.wso2.carbon.security.config.SecurityConfigAdmin

    public static void configureService(String serviceName) throws IdentityProviderException {
        try {
            AxisConfiguration axisConfig = IdentitySTSMgtServiceComponent.getConfigurationContext()
                    .getAxisConfiguration();

            SecurityConfigAdmin admin = new SecurityConfigAdmin(axisConfig,
                    IdentitySTSMgtServiceComponent.getRegistryService().getConfigSystemRegistry(),
                    new IPPasswordCallbackHandler());

            ServerConfiguration serverConfig = ServerConfiguration.getInstance();
            String ksName = serverConfig.getFirstProperty("Security.KeyStore.Location");
            ksName = ksName.substring(ksName.lastIndexOf("/") + 1);

            if (log.isDebugEnabled()) {
                log.debug("Applying identity security policy for service " + serviceName);
            }
           
            if (IdentityProviderUtil.isIntial()) {

                if (IdentityConstants.SERVICE_NAME_STS_UT.equals(serviceName)) {
                    admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_UT, "scenario19", null, null,
                            null, null);
                } else if (IdentityConstants.OpenId.SERVICE_NAME_STS_OPENID.equals(serviceName)) {
                    admin.applySecurity(IdentityConstants.OpenId.SERVICE_NAME_STS_OPENID,
                            "scenario19", null, null, null, null);
                } else if (IdentityConstants.SERVICE_NAME_STS_IC.equals(serviceName)) {
                    admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_IC, "scenario18",
                            null, new String[] { ksName }, ksName, null);
                } else if (IdentityConstants.OpenId.SERVICE_NAME_STS_IC_OPENID.equals(serviceName)) {
                    admin.applySecurity(IdentityConstants.OpenId.SERVICE_NAME_STS_IC_OPENID,
                            "scenario18", null, new String[] { ksName }, ksName, null);
                } else if (IdentityConstants.SERVICE_NAME_STS_UT_SYMM.equals(serviceName)) {
                    admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_UT_SYMM, "scenario18",
                            null, new String[] { ksName }, ksName, null);
                } else if (IdentityConstants.SERVICE_NAME_STS_IC_SYMM.equals(serviceName)) {
                    admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_IC_SYMM, "scenario18",
                            null, new String[] { ksName }, ksName, null);
                }
            }
           
            if (IdentityConstants.SERVICE_NAME_STS_UT.equals(serviceName)) {
View Full Code Here

Examples of org.wso2.carbon.security.config.SecurityConfigAdmin

        try {
            ServerConfiguration serverConfig = ServerConfiguration.getInstance();
            String ksName = serverConfig.getFirstProperty("Security.KeyStore.Location");
            ksName = ksName.substring(ksName.lastIndexOf("/") + 1);

            SecurityConfigAdmin admin = new SecurityConfigAdmin(config, registry,
                    new IPPasswordCallbackHandler());
            if (log.isDebugEnabled()) {
                log.debug("Applying identity security policy for Identity STS services");
            }

            if (IdentityProviderUtil.isIntial()) {
                if (axisConfig.getService(IdentityConstants.SERVICE_NAME_STS_UT) != null) {
                    admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_UT, "scenario19", null, null,
                            null, null);
                }
                if (axisConfig.getService(IdentityConstants.OpenId.SERVICE_NAME_STS_OPENID) != null) {
                    admin.applySecurity(IdentityConstants.OpenId.SERVICE_NAME_STS_OPENID,
                            "scenario19", null, null, null, null);
                }
                if (axisConfig.getService(IdentityConstants.SERVICE_NAME_STS_IC) != null) {
                    admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_IC, "scenario18",
                            null, new String[] { ksName }, ksName, null);
                }
                if (axisConfig.getService(IdentityConstants.OpenId.SERVICE_NAME_STS_IC_OPENID) != null) {
                    admin.applySecurity(IdentityConstants.OpenId.SERVICE_NAME_STS_IC_OPENID,
                            "scenario18", null, new String[] { ksName }, ksName, null);
                }
                if (axisConfig.getService(IdentityConstants.SERVICE_NAME_STS_UT_SYMM) != null) {
                    admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_UT_SYMM, "scenario18",
                            null, new String[] { ksName }, ksName, null);
                }
                if (axisConfig.getService(IdentityConstants.SERVICE_NAME_STS_IC_SYMM) != null) {
                    admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_IC_SYMM, "scenario18",
                            null, new String[] { ksName }, ksName, null);
                }
            }         

            if (axisConfig.getService(IdentityConstants.SERVICE_NAME_STS_UT) != null) {
View Full Code Here

Examples of org.wso2.carbon.security.config.SecurityConfigAdmin

public class SecurityConfigAdminService extends AbstractAdmin {

    public void activateUsernameTokenAuthentication(String serviceName, String[] userGroups)
            throws SecurityConfigException {
        SecurityConfigAdmin admin = new SecurityConfigAdmin(getUserRealm(), getConfigSystemRegistry(), getAxisConfig());
        admin.activateUsernameTokenAuthentication(serviceName, userGroups);

    }
View Full Code Here

Examples of org.wso2.carbon.security.config.SecurityConfigAdmin

    }

    public void disableSecurityOnService(String serviceName) throws SecurityConfigException {

        SecurityConfigAdmin admin = new SecurityConfigAdmin(getUserRealm(), getConfigSystemRegistry(), getAxisConfig());
        admin.disableSecurityOnService(serviceName);
    }
View Full Code Here

Examples of org.wso2.carbon.security.config.SecurityConfigAdmin

        admin.disableSecurityOnService(serviceName);
    }

    public void applySecurity(String serviceName, String policyId, String policyPath, String[] trustedStores,
        String privateStore, String[] userGroupNames) throws SecurityConfigException {
        SecurityConfigAdmin admin = new SecurityConfigAdmin(getUserRealm(), getConfigSystemRegistry(), getAxisConfig());
        admin.applySecurity(serviceName, policyId, policyPath, trustedStores, privateStore, userGroupNames);
    }
View Full Code Here

Examples of org.wso2.carbon.security.config.SecurityConfigAdmin

        if (servicePrincipalPassword == null || servicePrincipalPassword.trim().equals("")) {
            throw new SecurityConfigException("Please specify a valid service principal password. " +
                    "Service principal password should not be null");
        }

        SecurityConfigAdmin admin = new SecurityConfigAdmin(getUserRealm(), getConfigSystemRegistry(), getAxisConfig());

        KerberosConfigData kerberosConfigurations = new KerberosConfigData();
        kerberosConfigurations.setServicePrincipleName(servicePrincipalName);
        kerberosConfigurations.setServicePrinciplePassword(servicePrincipalPassword);

        admin.applySecurity(serviceName, policyId, kerberosConfigurations);

    }
View Full Code Here

Examples of org.wso2.carbon.security.config.SecurityConfigAdmin

        return scenarioDataWrapper;
    }

    private SecurityScenarioData getCurrentScenario(String serviceName)
            throws SecurityConfigException {
        SecurityConfigAdmin admin = new SecurityConfigAdmin(getUserRealm(), getConfigSystemRegistry(), getAxisConfig());
        return admin.getCurrentScenario(serviceName);
    }
View Full Code Here

Examples of org.wso2.carbon.security.config.SecurityConfigAdmin

        SecurityConfigAdmin admin = new SecurityConfigAdmin(getUserRealm(), getConfigSystemRegistry(), getAxisConfig());
        return admin.getCurrentScenario(serviceName);
    }

    public SecurityScenarioData getSecurityScenario(String sceneId) throws SecurityConfigException {
        SecurityConfigAdmin admin = new SecurityConfigAdmin(getUserRealm(), getConfigSystemRegistry(), getAxisConfig());
        return admin.getSecurityScenario(sceneId);
    }
View Full Code Here

Examples of org.wso2.carbon.security.config.SecurityConfigAdmin

        return admin.getSecurityScenario(sceneId);
    }

    public SecurityConfigData getSecurityConfigData(String serviceName, String scenarioId, String policyPath)
            throws SecurityConfigException {
        SecurityConfigAdmin admin = new SecurityConfigAdmin(getUserRealm(), getConfigSystemRegistry(), getAxisConfig());
        return admin.getSecurityConfigData(serviceName, scenarioId, policyPath);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.