Package org.apache.jackrabbit.oak.spi.security.authentication

Examples of org.apache.jackrabbit.oak.spi.security.authentication.PreAuthenticatedLogin


        }
        credentials = getCredentials();

        // check if we have a pre authenticated login from a previous login module
        final String userId;
        final PreAuthenticatedLogin preAuthLogin = getSharedPreAuthLogin();
        if (preAuthLogin != null) {
            userId = preAuthLogin.getUserId();
        } else {
            userId = credentials instanceof SimpleCredentials ? ((SimpleCredentials) credentials).getUserID() : null;
        }
        if (userId == null && credentials == null) {
            log.debug("No credentials found for external login module. ignoring.");
            return false;
        }

        try {
            SyncedIdentity sId = null;
            if (userId != null) {
                sId = syncHandler.findIdentity(getUserManager(), userId);
                // if there exists an authorizable with the given userid but is not an external one or if it belongs to
                // another IDP, we just ignore it.
                if (sId != null) {
                    if (sId.getExternalIdRef() == null) {
                        log.debug("ignoring local user: {}", sId.getId());
                        return false;
                    }
                    if (!sId.getExternalIdRef().getProviderName().equals(idp.getName())) {
                        if (log.isDebugEnabled()) {
                            log.debug("ignoring foreign identity: {} (idp={})", sId.getExternalIdRef().getString(), idp.getName());
                        }
                        return false;
                    }
                }
            }

            if (preAuthLogin != null) {
                externalUser = idp.getUser(preAuthLogin.getUserId());
            } else {
                externalUser = idp.authenticate(credentials);
            }

            if (externalUser != null) {
View Full Code Here


    public boolean login() throws LoginException {
        final boolean success;
        credentials = getCredentials();

        // check if we have a pre authenticated login from a previous login module
        PreAuthenticatedLogin preAuthLogin = getSharedPreAuthLogin();
        if (preAuthLogin != null) {
            userId = preAuthLogin.getUserId();
            Authentication authentication = new UserAuthentication(userId, getUserManager());
            success = authentication.authenticate(UserAuthentication.PRE_AUTHENTICATED);

        } else {
            userId = getUserId();
View Full Code Here

        }
        credentials = getCredentials();

        // check if we have a pre authenticated login from a previous login module
        final String userId;
        final PreAuthenticatedLogin preAuthLogin = getSharedPreAuthLogin();
        if (preAuthLogin != null) {
            userId = preAuthLogin.getUserId();
        } else {
            userId = credentials instanceof SimpleCredentials ? ((SimpleCredentials) credentials).getUserID() : null;
        }
        if (userId == null && credentials == null) {
            log.debug("No credentials found for external login module. ignoring.");
            return false;
        }

        try {
            SyncedIdentity sId = null;
            if (userId != null) {
                sId = syncHandler.findIdentity(getUserManager(), userId);
                // if there exists an authorizable with the given userid but is not an external one or if it belongs to
                // another IDP, we just ignore it.
                if (sId != null) {
                    if (sId.getExternalIdRef() == null) {
                        log.debug("ignoring local user: {}", sId.getId());
                        return false;
                    }
                    if (!sId.getExternalIdRef().getProviderName().equals(idp.getName())) {
                        if (log.isDebugEnabled()) {
                            log.debug("ignoring foreign identity: {} (idp={})", sId.getExternalIdRef().getString(), idp.getName());
                        }
                        return false;
                    }
                }
            }

            if (preAuthLogin != null) {
                externalUser = idp.getUser(preAuthLogin.getUserId());
            } else {
                externalUser = idp.authenticate(credentials);
            }

            if (externalUser != null) {
View Full Code Here

    public boolean login() throws LoginException {
        final boolean success;
        credentials = getCredentials();

        // check if we have a pre authenticated login from a previous login module
        PreAuthenticatedLogin preAuthLogin = getSharedPreAuthLogin();
        if (preAuthLogin != null) {
            userId = preAuthLogin.getUserId();
            Authentication authentication = getUserAuthentication(userId);
            success = authentication != null && authentication.authenticate(PreAuthenticatedLogin.PRE_AUTHENTICATED);
        } else {
            userId = getUserId();
            Authentication authentication = getUserAuthentication(userId);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.security.authentication.PreAuthenticatedLogin

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.