Package javax.security.auth.login

Examples of javax.security.auth.login.AccountNotFoundException


    /**
     * @tests javax.security.auth.login.AccountNotFoundException#AccountNotFoundException(
     *        java.lang.String)
     */
    public final void testCtor2() {
        assertNull(new AccountNotFoundException(null).getMessage());

        String message = "";
        assertSame(message, new AccountNotFoundException(message).getMessage());

        message = "message";
        assertSame(message, new AccountNotFoundException(message).getMessage());
    }
View Full Code Here


    {
        char[] pwd = lookupPassword(principal);
       
        if (pwd == null)
        {
            throw new AccountNotFoundException("Unable to lookup the specified users password");
        }
       
        byte[] byteArray = new byte[password.length];
        int index = 0;
        for (char c : password)
View Full Code Here

        char[] pwd = lookupPassword(principal);
       
        if (pwd == null)
        {
            throw new AccountNotFoundException("Unable to lookup the specified users password");
        }

        return compareCharArray(pwd, password);

    }
View Full Code Here

    public void setPassword(Principal principal, PasswordCallback callback) throws IOException,
            AccountNotFoundException
    {
        if (_passwordFile == null)
        {
            throw new AccountNotFoundException("Unable to locate principal since no password file was specified during initialisation");
        }
        if (principal == null)
        {
            throw new IllegalArgumentException("principal must not be null");
        }
        char[] pwd = lookupPassword(principal.getName());
        if (pwd != null)
        {
            callback.setPassword(pwd);
        }
        else
        {
            throw new AccountNotFoundException("No account found for principal " + principal);
        }
    }
View Full Code Here

public class AccountNotFoundExceptionTest extends SerializationTest {

    @Override
    protected Object[] getData() {
        return new Object[] {new AccountNotFoundException("message")};
    }
View Full Code Here

                {
                    authUser.delete();
                }
                else
                {
                    throw new AccountNotFoundException("No such user: '" + user + "'");
                }
            }
        });
    }
View Full Code Here

                {
                    authUser.setPassword(password);
                }
                else
                {
                    throw new AccountNotFoundException("No such user: '" + username + "'");
                }
            }
        });

    }
View Full Code Here

        char[] pwd = lookupPassword(principal);
       
        if (pwd == null)
        {
            throw new AccountNotFoundException("Unable to lookup the specified users password");
        }

        return compareCharArray(pwd, password);

    }
View Full Code Here

    {
        char[] pwd = lookupPassword(principal);
       
        if (pwd == null)
        {
            throw new AccountNotFoundException("Unable to lookup the specified users password");
        }
       
        byte[] byteArray = new byte[password.length];
        int index = 0;
        for (char c : password)
View Full Code Here

        // get the name, and make sure they have a password entry
        String name = npc.getName();
        byte [] validPass = passwordMap.get(name);
        if (validPass == null) {
            throw new AccountNotFoundException("Unknown user: " + name);
        }

        // hash the given password
        byte [] pass = null;
        synchronized (digest) {
View Full Code Here

TOP

Related Classes of javax.security.auth.login.AccountNotFoundException

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.