Examples of AuthenticationResult


Examples of com.evernote.edam.userstore.AuthenticationResult

             logger.log(logger.EXTREME, "Share Key Not Null: " +books.get(i).getShareKey());
             linkedAuthResult = linkedNoteStore.authenticateToSharedNotebook(books.get(i).getShareKey(), authToken);
             logger.log(logger.EXTREME, "Authentication Token" +linkedAuthResult.getAuthenticationToken());
           } else {
             logger.log(logger.EXTREME, "Share key is null");
             linkedAuthResult = new AuthenticationResult();
             linkedAuthResult.setAuthenticationToken("");
           }
           SyncState linkedSyncState =
             linkedNoteStore.getLinkedNotebookSyncState(linkedAuthResult.getAuthenticationToken(), books.get(i));
           if (linkedSyncState.getUpdateCount() > lastSequenceNumber) {
View Full Code Here

Examples of com.stormpath.sdk.authc.AuthenticationResult

                // For authentication the only thing we need to do is call Application.authenticate(),
                // instantiating the proper AuthenticationRequest (UsernamePasswordRequest in this case),
                // providing the account's credentials.
                AuthenticationRequest request = new UsernamePasswordRequest(customer.getUserName(), customer.getPassword());
                AuthenticationResult authcResult = stormpath.getApplication().authenticateAccount(request);

                Account account = authcResult.getAccount();

                User user = new User(account);

                // If the customer queried from the database does not exist
                // we create it in the application's internal database,
View Full Code Here

Examples of fi.luomus.commons.utils.LintuvaaraAuthenticationUtil.AuthenticationResult

    LintuvaaraAuthenticationUtil authUtil = new LintuvaaraAuthenticationUtil(decryptor, "pistelaskenta", allowedUserTypes);

    String key = "these you get";
    String iv = "as a parameter";
    String model = "from the user";
    AuthenticationResult result = authUtil.check(key, iv, model);
    if (result.success()) {
      // do something...
      result.getUsermodel().get("login_id");
    } else {
      // do something else
      assert(result.getCause().equals("incorrect login parameters"));
    }
  }
View Full Code Here

Examples of org.apache.archiva.redback.authentication.AuthenticationResult

    @Override
    public SecuritySession authenticate( AuthenticationDataSource source )
        throws AuthenticationException, UserNotFoundException, AccountLockedException
    {
        AuthenticationResult result = null;
        SecuritySession session = null;

        if ( users.get( source.getUsername() ) != null )
        {
            result = new AuthenticationResult( true, source.getUsername(), null );

            User user = new JdoUser();
            user.setUsername( source.getUsername() );
            user.setPassword( users.get( source.getUsername() ) );

            session = new DefaultSecuritySession( result, user );
        }
        else
        {
            result = new AuthenticationResult( false, source.getUsername(), null );
            session = new DefaultSecuritySession( result );
        }
        return session;
    }
View Full Code Here

Examples of org.apache.qpid.server.security.auth.AuthenticationResult

                if (_logger.isDebugEnabled())
                {
                    _logger.debug("Authenticated as " + authorizationID);
                }

                return new AuthenticationResult(new UsernamePrincipal(authorizationID));
            }
            else
            {
                return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
            }
        }
        catch (SaslException e)
        {
            return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
        }
    }
View Full Code Here

Examples of org.apache.qpid.server.security.auth.AuthenticationResult

    @Override
    public AuthenticationResult authenticate(String username, String password)
    {
        try
        {
            AuthenticationResult result = doLDAPNameAuthentication(getNameFromId(username), password);
            if(result.getStatus() == AuthenticationStatus.SUCCESS)
            {
                //Return a result based on the supplied username rather than the search name
                return new AuthenticationResult(new UsernamePrincipal(username));
            }
            else
            {
                return result;
            }
        }
        catch (NamingException e)
        {
            return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
        }
    }
View Full Code Here

Examples of org.apache.qpid.server.security.auth.AuthenticationResult

    private AuthenticationResult doLDAPNameAuthentication(String name, String password)
    {
        if(name == null)
        {
            //The search didn't return anything, class as not-authenticated before it NPEs below
            return new AuthenticationResult(AuthenticationStatus.CONTINUE);
        }

        Hashtable<String, Object> env = createInitialDirContextEnvironment(_providerAuthURL);

        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, name);
        env.put(Context.SECURITY_CREDENTIALS, password);

        InitialDirContext ctx = null;
        try
        {
            ctx = createInitialDirContext(env);

            //Authentication succeeded
            return new AuthenticationResult(new UsernamePrincipal(name));
        }
        catch(AuthenticationException ae)
        {
            //Authentication failed
            return new AuthenticationResult(AuthenticationStatus.CONTINUE);
        }
        catch (NamingException e)
        {
            //Some other failure
            return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
        }
        finally
        {
            if(ctx != null)
            {
View Full Code Here

Examples of org.apache.qpid.server.security.auth.AuthenticationResult

        @Override
        public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
        {
            String name = null;
            String password = null;
            AuthenticationResult authenticated = null;
            for(Callback callback : callbacks)
            {
                if (callback instanceof NameCallback)
                {
                    String id = ((NameCallback) callback).getDefaultName();
                    try
                    {
                        name = getNameFromId(id);
                    }
                    catch (NamingException e)
                    {
                        _logger.warn("SASL Authentication Exception", e);
                    }
                    if(password != null)
                    {
                        authenticated = doLDAPNameAuthentication(name, password);
                    }
                }
                else if (callback instanceof PlainPasswordCallback)
                {
                    password = ((PlainPasswordCallback)callback).getPlainPassword();
                    if(name != null)
                    {
                        authenticated = doLDAPNameAuthentication(name, password);
                        if(authenticated.getStatus()== AuthenticationResult.AuthenticationStatus.SUCCESS)
                        {
                            ((PlainPasswordCallback)callback).setAuthenticated(true);
                        }
                    }
                }
                else if (callback instanceof AuthorizeCallback)
                {
                    ((AuthorizeCallback) callback).setAuthorized(authenticated != null && authenticated.getStatus() == AuthenticationResult.AuthenticationStatus.SUCCESS);
                }
                else
                {
                    throw new UnsupportedCallbackException(callback);
                }
View Full Code Here

Examples of org.apache.qpid.server.security.auth.AuthenticationResult

    }

    public void testAuthenticatePrincipalNull_CausesAuthError() throws Exception
    {
        SaslServer saslServer = _manager.createSaslServer("EXTERNAL", "example.example.com", null);
        AuthenticationResult result = _manager.authenticate(saslServer, new byte[0]);

        assertNotNull(result);
        assertEquals("Expected authentication to be unsuccessful",
                AuthenticationResult.AuthenticationStatus.ERROR,
                result.getStatus());
        assertNull(saslServer.getAuthorizationID());
    }
View Full Code Here

Examples of org.apache.qpid.server.security.auth.AuthenticationResult

    public void testAuthenticatePrincipalNoCn_CausesAuthError() throws Exception
    {
        X500Principal principal = new X500Principal("DC=example, DC=com, O=My Company Ltd, L=Newbury, ST=Berkshire, C=GB");
        SaslServer saslServer = _manager.createSaslServer("EXTERNAL", "example.example.com", principal);
        AuthenticationResult result = _manager.authenticate(saslServer, new byte[0]);

        assertNotNull(result);
        assertEquals("Expected authentication to be unsuccessful",
                AuthenticationResult.AuthenticationStatus.ERROR,
                result.getStatus());
        assertNull(saslServer.getAuthorizationID());
    }
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.