Package de.innovationgate.wgpublisher.WGACore

Examples of de.innovationgate.wgpublisher.WGACore.DomainConfiguration


    private void assingRoleToDefaultManager(WGDatabase db, WGACL acl, ACLRole role) {

        try {
            // Retrieve default manager
            DomainConfiguration domain = _core.getDomainConfigForDatabase(db);
            if (domain == null || domain.getDefaultManager() == null) {
                return;
            }
           
            // Retrieve ACL entry for default manager
            WGACLEntry aclEntry = acl.getEntry(domain.getDefaultManager());
            if (aclEntry == null) {
                acl.createUserEntry(domain.getDefaultManager(), WGDatabase.ACCESSLEVEL_MANAGER);
            }
           
            // Modify flags to include role and store
            WGACLEntryFlags flags = acl.parseFlags(aclEntry);
            if (!flags.getRoles().contains(role.getName())) {
View Full Code Here


   
    public int login(WGDatabase db, String username, String password) throws WGAPIException {
       
       
        String domain = (String) db.getAttribute(WGACore.DBATTRIB_DOMAIN);
        DomainConfiguration domainConfig = _core.getDomainConfig(domain);
        LoginAttemptInformation inf = getLoginAttemptInformation(domain, username);
        if (inf != null && inf.isBlocked()) {
            LOG.warn("Failed login for '" + username + "': Username is blocked because of too many wrong login attempts (Brute force login blocker on database " + db.getDbReference() + ")");
            return WGDatabase.ACCESSLEVEL_NOTLOGGEDIN;
        }
       
        int level = (db.isSessionOpen() ? db.reopenSession(username, password) : db.openSession(username, password));
        
        if (level == WGDatabase.ACCESSLEVEL_NOTLOGGEDIN) {
            if (inf == null) {
                inf = new LoginAttemptInformation(domain, username, domainConfig.getMaximumLoginAttempts());
                inf.map(_failedLoginAttempts);
            }
            inf.addFailedAttempt();
           
            if (inf.isBlocked()) {
View Full Code Here


  public RemoteSession login(String domain, String user, String pwd) throws WGAServiceException {
    WGAConfiguration config = _core.getWgaConfiguration();

        DomainConfiguration domainConfig = _core.getDomainConfig(domain);
        if (domainConfig == null) {
            throw new WGAServiceException("Unknown domain '" + domain + "'");
        }
       
        if (domainConfig.getAuthModule() != null) {
            try {
                if (_core.getBruteForceLoginBlocker().login(domainConfig, user, pwd) == null) {
                    throw new WGAServiceException("Invalid login");  
                }
            }
            catch (AuthenticationException e) {
                throw new WGAServiceException("Authentication exception logging into domain '" + domain + "': " + e.getMessage());
            }
        }
       
        return new RemoteSession(domainConfig.getName(), user, pwd);
  }
View Full Code Here

            }
           
            // Normal db user login
            if (session.getDomain() != null) {
              
                DomainConfiguration domainConfig = _core.getDomainConfigForDatabase(db);
                if (!domainConfig.getName().equals(session.getDomain())) {
                    throw new WGAServiceException("The database '" + db.getDbReference() + "' is not in domain '" + session.getDomain() + "'");
                }
               
                if (_core.getBruteForceLoginBlocker().login(db, session.getUsername(), session.getPassword()) <= WGDatabase.ACCESSLEVEL_NOACCESS) {
                    throw new WGAServiceException("Login is invalid or no access to database '" + dbkey + "'");
View Full Code Here

       
        if (!_ready) {
            return null;
        }
       
        DomainConfiguration conf = _core.getDomainConfig(_domainName);
        if (conf != null) {       
            return conf.getAuthModule();
        }
        else {
            return null;
        }
    }
View Full Code Here

        _domain = domain;
    }

    @Override
    public AuthenticationModule getBackendModule() {
        DomainConfiguration domainConfig = _core.getDomainConfig(_domain);
        if (domainConfig != null) {
            return domainConfig.getAuthModule();
        }
        else {
            return FakeAuthModule.INSTANCE;
        }
    }
View Full Code Here

            tmlContext.setLastError(null);
            return tmlContext;
        }

        public TMLUserProfile getUserProfile(WGDatabase db) {
            DomainConfiguration domainConfig = getCore().getDomainConfigForDatabase(db);
           
            TMLUserProfile profile = (TMLUserProfile) _pageContext.getRequest().getAttribute(WGACore.ATTRIB_PROFILE + db.getDbReference());
            if (profile == null) {
                try {
                   return getCore().getDispatcher().fetchUserProfile((HttpServletRequest) _pageContext.getRequest(), (HttpServletResponse) _pageContext.getResponse(), db, _pageContext.getSession());
View Full Code Here

        super.release();
    }

    public TMLUserProfile getUserProfile(WGDatabase db) {

        DomainConfiguration domainConfig = getCore().getDomainConfigForDatabase(db);
       
        TMLUserProfile profile = (TMLUserProfile) getPageContext().getRequest().getAttribute(WGACore.ATTRIB_PROFILE + db.getDbReference());
        if (profile == null) {
            try {
               return getDispatcher().fetchUserProfile((HttpServletRequest) getPageContext().getRequest(), (HttpServletResponse) getPageContext().getResponse(), db, getPageContext().getSession());
View Full Code Here

              return WGDatabase.ANONYMOUS_USER;
          }
      }
     
      else if (name.equalsIgnoreCase("defaultmanager")) {
          DomainConfiguration dc = getwgacore().getDomainConfig(domainName);
          if (dc == null) {
                addwarning("No configuration found for domain: " + domainName);
                return null;
            }
         
          return dc.getDefaultManager();
      }
     
      else if (name.equalsIgnoreCase("authentication") || name.equalsIgnoreCase("auth")) {
          DomainConfiguration dc = getwgacore().getDomainConfig(domainName);
            if (dc == null) {
                addwarning("No configuration found for domain: " + domainName);
                return null;
            }
           
            AuthenticationModule authModule = dc.getAuthModule();
            if (authModule != null) {
                return authModule.getAuthenticationSource();
            }
            else {
                return null;
View Full Code Here

        // Change password on login info
        loginInfo.setCredentials(newPassword);
       
        // Change cached password on domain auth module, if it is password-caching
        if (!WGDatabase.SESSIONTOKEN_USER.equals(loginInfo.getUserName())) {
            DomainConfiguration domConfig = getwgacore().getDomainConfig(domain);
            if (domConfig != null && domConfig.getAuthModule() instanceof PasswordCachingAuthenticationModule) {
                PasswordCachingAuthenticationModule module = (PasswordCachingAuthenticationModule) domConfig.getAuthModule();
                module.dropPasswordCache(loginInfo.getUserName());       
    }
        }
       
       
View Full Code Here

TOP

Related Classes of de.innovationgate.wgpublisher.WGACore.DomainConfiguration

Copyright © 2018 www.massapicom. 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.