Examples of Authenticator


Examples of org.exoplatform.services.security.Authenticator

            // Now add our user to requested group
            log.info("User " + identity.getUserId() + " will be added to group " + groupId + " as " + membershipType + ".");
            addUserToPlatformUsers(identity.getUserId());

            // Recreate identity
            Authenticator authenticator = (Authenticator) getContainer().getComponentInstanceOfType(Authenticator.class);
            identity = authenticator.createIdentity(identity.getUserId());
            sharedState.put("exo.security.identity", identity);
            return true;
        } catch (Exception e) {
            LoginException le = new LoginException();
            le.initCause(e);
View Full Code Here

Examples of org.jboss.com.sun.net.httpserver.Authenticator

    public static ManagementHttpServer create(InetSocketAddress bindAddress, InetSocketAddress secureBindAddress, int backlog, ModelControllerClient modelControllerClient, Executor executor, SecurityRealm securityRealm, ConsoleMode consoleMode, String consoleSlot)
            throws IOException {
        Map<String, String> configuration = new HashMap<String, String>(1);
        configuration.put("sun.net.httpserver.maxReqTime", "15"); // HTTP Server to close connections if initial request not received within 15 seconds.

        Authenticator auth = null;
        final CertAuth certAuthMode;

        if (securityRealm != null) {
            DomainCallbackHandler callbackHandler = securityRealm.getCallbackHandler();
            Class<Callback>[] supportedCallbacks = callbackHandler.getSupportedCallbacks();
View Full Code Here

Examples of org.jwall.web.audit.util.Authenticator

    public static void main(String args[]){
        try {
            File auditFile = null;
            int port = 10001;
            long skip = 0;
            Authenticator auth = null;

            if(args.length == 0){
                printUsage();
                System.exit(-1);
            }
View Full Code Here

Examples of org.mortbay.http.Authenticator

        } else {
            unauthenticated = true;
        }

        UserRealm realm = getRealm();
        Authenticator authenticator = getAuthenticator();
        Principal user = null;
        if (!unauthenticated && !forbidden) {
            if (realm == null) {
                log.warn("Realm Not Configured");
                throw new HttpException(HttpResponse.__500_Internal_Server_Error, "Realm Not Configured");
            }


            // Handle pre-authenticated request
            if (authenticator != null) {
                // User authenticator.
                user = authenticator.authenticate(realm, pathInContext, request, response);
            } else {
                // don't know how authenticate
                log.warn("Mis-configured Authenticator for " + request.getPath());
                throw new HttpException(HttpResponse.__500_Internal_Server_Error, "Mis-configured Authenticator for " + request.getPath());
            }

            return user;
        } else if (authenticator instanceof FormAuthenticator && pathInContext.endsWith(FormAuthenticator.__J_SECURITY_CHECK)) {
            /**
             * This could be a post request to __J_SECURITY_CHECK.
             */
            if (realm == null) {
                log.warn("Realm Not Configured");
                throw new HttpException(HttpResponse.__500_Internal_Server_Error, "Realm Not Configured");
            }
            return authenticator.authenticate(realm, pathInContext, request, response);
        }

        /**
         * No authentication is required.  Return the defaultPrincipal.
         */
 
View Full Code Here

Examples of org.mortbay.jetty.security.Authenticator

                substitutedPathInContext = substitutedPathInContext.replaceAll("%3A", "%3A%3A");
            if (substitutedPathInContext.indexOf(":") > -1)
                substitutedPathInContext = substitutedPathInContext.replaceAll(":", "%3A");


            Authenticator authenticator = getAuthenticator();
            boolean isAuthenticated = false;

            if (authenticator instanceof FormAuthenticator
                    && pathInContext.endsWith(FormAuthenticator.__J_SECURITY_CHECK)) {
                /**
                 * This is a post request to __J_SECURITY_CHECK. Stop now after authentication.
                 * Whether or not authentication succeeded, we return.
                 */
                authenticator.authenticate(realm, pathInContext, request, response);
                return false;
            }
            // attempt to access an unprotected resource that is not the
            // j_security_check.
            // if we are logged in, return the logged in principal.
            if (request != null) {
                // null response appears to prevent redirect to login page
                Principal user = authenticator.authenticate(realm, pathInContext,
                        request, null);
                if (user == null || user == SecurityHandler.__NOBODY) {
                    //TODO use run-as as nextCaller if present
                    ContextManager.setCallers(defaultPrincipal.getSubject(), defaultPrincipal.getSubject());
                    request.setUserPrincipal(new NotChecked());
                } else if (user != null) {
                    isAuthenticated = true;
                }
            }


            AccessControlContext acc = ContextManager.getCurrentContext();

            /**
             * JACC v1.0 section 4.1.1
             */
            WebUserDataPermission wudp = new WebUserDataPermission(substitutedPathInContext, new String[]{request.getMethod()}, transportType);
            acc.checkPermission(wudp);

            WebResourcePermission webResourcePermission = new WebResourcePermission(request);
            /**
             * JACC v1.0 section 4.1.2
             */
            if (isAuthenticated) {
                //current user is logged in, this is the actual check
                acc.checkPermission(webResourcePermission);
            } else {
                //user is not logged in: if access denied, try to log them in.
                try {
                    acc.checkPermission(webResourcePermission);
                } catch (AccessControlException e) {
                    //not logged in: try to log them in.
                    Principal user = authenticator.authenticate(realm, pathInContext, request, response);
                    if (user == SecurityHandler.__NOBODY) {
                        return true;
                    }
                    if (user == null) {
                        throw e;
View Full Code Here

Examples of org.netbeans.server.uihandler.api.Authenticator

        String userName = params[USER_NAME_IDX];
        String passwd = "";
        if ((params.length > PASSWD_IDX) && (params[PASSWD_IDX] != null)) {
            passwd = params[PASSWD_IDX];
        }
        Authenticator auth = Authenticate.getAuthenticator();
        Authenticator.AuthToken userToken = null;
        if (auth != null) {
            userToken = auth.authenticate(userName, passwd);
            if (userToken == null) {
                params[USER_NAME_IDX] = BugReporter.GUEST_USER;
                params[PASSWD_IDX] = null;
            }
        }
View Full Code Here

Examples of org.ofbiz.common.authentication.api.Authenticator

    private synchronized static void loadAuthenticators_internal(LocalDispatcher dispatcher) {
        if (!authenticatorsLoaded) {
            Iterator<Authenticator> it = ServiceLoader.load(Authenticator.class, getContextClassLoader()).iterator();
            while (it.hasNext()) {
                try {
                    Authenticator auth = it.next();
                    if (auth.isEnabled()) {
                        auth.initialize(dispatcher);
                        authenticators.add(auth);
                    }
                } catch (ClassCastException e) {
                    Debug.logError(e, module);
                }
View Full Code Here

Examples of org.opencustomer.webapp.auth.Authenticator

                errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("module.common.login.error.noLdapConnection"));
            }
           
            if(errors.isEmpty()) {
                request.getSession().setAttribute(Globals.USER_KEY, user);
                request.getSession().setAttribute(Globals.AUTHENTICATOR_KEY, new Authenticator(user));
                request.getSession().setAttribute(org.apache.struts.Globals.LOCALE_KEY, user.getLocale());
                request.getSession().setAttribute(Globals.CONFIGURATION_KEY, new UserConfiguration(user));
               
                MenuFactory menuFactory = (MenuFactory)request.getSession().getServletContext().getAttribute(Globals.MENU_FACTORY_KEY);
                Menu menu = menuFactory.getCustomizedMenu(AuthenticatorUtility.getAuthenticator(request));
View Full Code Here

Examples of org.openqa.jetty.http.Authenticator

    {
        XmlParser.Node method=node.get("auth-method");
        FormAuthenticator _formAuthenticator=null;
        if(method!=null)
        {
            Authenticator authenticator=null;
            String m=method.toString(false,true);
            if(SecurityConstraint.__FORM_AUTH.equals(m))
                authenticator=_formAuthenticator=new FormAuthenticator();
            else if(SecurityConstraint.__BASIC_AUTH.equals(m))
                authenticator=new BasicAuthenticator();
View Full Code Here

Examples of org.opensaml.ws.wstrust.Authenticator

public class AuthenticatorUnmarshaller extends AbstractWSTrustObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        Authenticator authenticator = (Authenticator) parentXMLObject;
       
        if (childXMLObject instanceof CombinedHash) {
            authenticator.setCombinedHash((CombinedHash) childXMLObject);
        } else {
            authenticator.getUnknownXMLObjects().add(childXMLObject);
        }
    }
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.