Examples of UserRealm


Examples of org.wso2.carbon.user.core.UserRealm

            int tenantID = carbonContext.getTenantId();
            String tenantDomain = carbonContext.getTenantDomain();
            String servicePath = RegistryResources.SERVICE_GROUPS
                    + service.getAxisServiceGroup().getServiceGroupName()
                    + RegistryResources.SERVICES + serviceName;
            UserRealm userRealm = AnonymousSessionUtil.getRealmByTenantDomain(
                    SecurityServiceHolder.getRegistryService(), SecurityServiceHolder.getRealmService(), tenantDomain);

            Registry rootRegistry = SecurityServiceHolder.getRegistryService().getRegistry();
            UserRegistry configRegistry = SecurityServiceHolder.getRegistryService().getConfigSystemRegistry(tenantID);
View Full Code Here

Examples of org.wso2.carbon.user.core.UserRealm

    public UserFieldDTO[] readUserFieldsForUserRegistration(String dialect)
            throws IdentityException {
        IdentityClaimManager claimManager = null;
        Claim[] claims = null;
        List<UserFieldDTO> claimList = null;
        UserRealm realm = null;

        claimManager = IdentityClaimManager.getInstance();
        realm = IdentityTenantUtil.getRealm(null, null);
        claims = claimManager.getAllSupportedClaims(dialect, realm);
View Full Code Here

Examples of org.wso2.carbon.user.core.UserRealm

            for (UserFieldDTO userFieldDTO : userFieldDTOs) {
                userClaims.put(userFieldDTO.getClaimUri(), userFieldDTO.getFieldValue());
            }
        }

        UserRealm realm = null;
        realm = IdentityTenantUtil.getRealm(null, null);
        Registry registry = IdentityTenantUtil.getRegistry(null, null);
        addUser(user.getUserName(), user.getPassword(), userClaims, null, realm);

        // OpenId Sign-Up if necessary.
View Full Code Here

Examples of org.wso2.carbon.user.core.UserRealm

                    }
                }
                user = IdentityUtil.getPPIDDisplayValue(ppid);
                IdentityPersistenceManager manager = IdentityPersistenceManager
                        .getPersistanceManager();
                UserRealm realm = null;
                realm = IdentityTenantUtil.getRealm(null, null);
                Registry registry = null;
                registry = IdentityTenantUtil.getRegistry(null, null);
                addUser(user, uuid, userClaims, null, realm);
                PPIDValueDO ppidValueDO = new PPIDValueDO();
View Full Code Here

Examples of org.wso2.carbon.user.core.UserRealm

    public void addUserWithOpenID(OpenIDDTO openID) throws Exception {
    }

    public boolean isAddUserEnabled() throws Exception {
      
        UserRealm userRealm = IdentityTenantUtil.getRealm(null, null);
        if (userRealm != null) {
            UserStoreManager userStoreManager = userRealm.getUserStoreManager();
            if (userStoreManager != null) {
                return !userStoreManager.isReadOnly();
            }
        }
View Full Code Here

Examples of org.wso2.carbon.user.core.UserRealm

        boolean isAuthenticated = false;
        boolean isAuthorized = false;
        String tenantAwareUserName = TenantUtils.getTenantAwareUsername(user);
        try {

            UserRealm realm = AnonymousSessionUtil.getRealmByUserName(
                    SecurityServiceHolder.getRegistryService(),
                    SecurityServiceHolder.getRealmService(),user);
            isAuthorized = realm.getAuthorizationManager().isUserAuthorized(tenantAwareUserName,
                                                                            servicePath,
                                                                            UserCoreConstants.
                                                                                    INVOKE_SERVICE_PERMISSION);

            if (isAuthorized == true) {
                isAuthenticated = realm.getUserStoreManager().authenticate(tenantAwareUserName, password);
            }

            return isAuthenticated;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
View Full Code Here

Examples of org.wso2.carbon.user.core.UserRealm

                    "The realm service is not available.";
            log.error(msg);
            throw new RegistryException(msg);
        }
        try {
            UserRealm realm = registryContext.getRealmService().getBootstrapRealm();
            return new RegistryRealm(realm);
        } catch (Exception e) {
            String msg = "Error in getting the user realm for main tenant.";
            log.error(msg);
            throw new RegistryException(msg, e);
View Full Code Here

Examples of org.wso2.carbon.user.core.UserRealm

     * @return the bootstrap realm.
     * @throws RegistryException if the operation failed.
     */
    public static UserRealm getBootstrapRealm(RealmService realmService) throws RegistryException {
        try {
            UserRealm realm = realmService.getBootstrapRealm();
            return new RegistryRealm(realm);
        } catch (Exception e) {
            String msg = "Error in getting the user realm for main tenant.";
            log.error(msg);
            throw new RegistryException(msg, e);
View Full Code Here

Examples of org.wso2.carbon.user.core.UserRealm

            throws RegistryException {

        boolean putAllowed = false;

        UserRegistry userRegistry = Utils.getSecureRegistry(request);
        UserRealm userRealm = userRegistry.getUserRealm();

        try {
            if (userRealm.getAuthorizationManager().isUserAuthorized(
                    userName, resourcePath, ActionConstants.PUT)) {
                putAllowed = true;
            }
        } catch (UserStoreException e) {
View Full Code Here

Examples of org.wso2.carbon.user.core.UserRealm

            throws RegistryException {

        boolean putAllowed = false;

        UserRegistry userRegistry = Utils.getSecureRegistry(request);
        UserRealm userRealm = userRegistry.getUserRealm();

        try {
            if (userRealm.getAuthorizationManager().isUserAuthorized(
                    userName, resourcePath, ActionConstants.DELETE)) {
                putAllowed = true;
            }
        } catch (UserStoreException e) {
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.