Package de.innovationgate.webgate.api.auth

Examples of de.innovationgate.webgate.api.auth.AuthenticationSession


        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 domain " + domainConfig.getName() + ")");
            return null;
        }
       
        AuthenticationSession authSession = domainConfig.getAuthModule().login(username, password);
        if (authSession != null) {
            if (inf != null) {
                inf.reset();
            }
            return authSession;
View Full Code Here


        // Do login. Either on domain's auth module or on a DB of the domain
        boolean isLoginSuccessful = false;
        if (domainConfig.getAuthModule() != null) {
            // Do a login on the domain's auth module
            try {
                AuthenticationSession authSession = getBruteForceLoginBlocker().login(domainConfig, user, password);
                if (authSession != null) {
                    isLoginSuccessful = true;
                }
            }
            catch (AuthenticationException e) {
View Full Code Here

        // If both params are null, the master login (from initial open command)
        // will be used
        boolean masterLogin = false;
       
        // Create authentication session
        AuthenticationSession authSession = null;
        AuthenticationModule authModule = getAuthenticationModule();

        // Master login
        if (user == null && credentials == null) {
            user = this.masterLoginInputName;
            credentials = this.masterLoginPassword;
            masterLogin = true;
            authSession = MasterLoginAuthSession.getInstance();
        }
       
        // Anonymous login
        else if (user.equals(WGDatabase.ANONYMOUS_USER)) {
            authSession = AnonymousAuthSession.getInstance();
        }
       
        // Regular login against authentication module
       
        else if (authModule != null) {
            if (certAuthEnabled() && (credentials instanceof X509Certificate)) {
                authSession = ((CertAuthCapableAuthModule) authModule).login((X509Certificate) credentials);
            }
            else {
                authSession = authModule.login(user, credentials);
            }
           
            if (authSession == null) {
                return WGDatabase.ACCESSLEVEL_NOTLOGGEDIN;
            }
        }
       
        // Backend login
        else if (hasFeature(FEATURE_PERFORMS_BACKEND_LOGIN)) {
            authSession = new BackendAuthSession(user, credentials);
        }
       
        // If no auth module and database does not accept backend logins we use an anonymous session
        else {
            authSession = AnonymousAuthSession.getInstance();
        }

        // Open core session
        WGUserAccess userAccess = this.core.openSession(authSession, credentials, masterLogin);
        if (userAccess.getAccessLevel() <= ACCESSLEVEL_NOACCESS) {
            return userAccess.getAccessLevel();
        }

        userHashMapGroup.fetchAllMapsForUser(authSession.getDistinguishedName());
        WGSessionContext sessionContext = new WGSessionContext(this, authSession, credentials, userAccess);
        sessionContext.setCachingEnabled(cachingEnabled);
        this.setSessionContext(sessionContext);
        core.setCurrentSession(sessionContext);
       
View Full Code Here

TOP

Related Classes of de.innovationgate.webgate.api.auth.AuthenticationSession

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.