Examples of PersistentLogin


Examples of org.eurekastreams.server.domain.PersistentLogin

     */
    @Test
    public void testCreateOrUpdateUpdateTokenExpirationDate()
    {
        // this user is already in db so update should happen.
        PersistentLogin login = new PersistentLogin("mrburns", "excellent1", expiryDate);
        jpaPersistentLoginMapper.createOrUpdate(login);

        PersistentLogin sutResult = jpaPersistentLoginMapper.findByAccountId("mrburns");
        assertEquals("PersistentLogin id is not same as original, update didn't happen", idInDb, sutResult.getId());

        assertEquals("PersistentLogin tokenExpirationDate not updated correctly", expiryDate, sutResult
                .getTokenExpirationDate());
    }
View Full Code Here

Examples of org.eurekastreams.server.domain.PersistentLogin

     * test createOrUpdate create token value.
     */
    @Test
    public void testCreateOrUpdateCreateTokenValue()
    {
        PersistentLogin login = new PersistentLogin("flanders", "diddly", expiryDate);
        jpaPersistentLoginMapper.createOrUpdate(login);

        PersistentLogin sutResult = jpaPersistentLoginMapper.findByAccountId("flanders");
        assertTrue("PersistentLogin id is zero, create didn't happen", 0L != sutResult.getId());

        assertEquals("PersistentLogin tokenValue not created correctly", "diddly", sutResult.getTokenValue());
    }
View Full Code Here

Examples of org.eurekastreams.server.domain.PersistentLogin

     */
    @Test
    public void testCreateOrUpdateUpdateTokenValue()
    {
        // this user is already in db so update should happen.
        PersistentLogin login = new PersistentLogin("mrburns", "excellent", expiryDate);
        jpaPersistentLoginMapper.createOrUpdate(login);

        PersistentLogin sutResult = jpaPersistentLoginMapper.findByAccountId("mrburns");
        assertEquals("PersistentLogin id is not same as original, update didn't happen", idInDb, sutResult.getId());

        assertEquals("PersistentLogin tokenValue not updated", "excellent", sutResult.getTokenValue());
    }
View Full Code Here

Examples of org.eurekastreams.server.domain.PersistentLogin

            log.debug(errorMessage);
            throw new UsernameNotFoundException(errorMessage);
        }

        Person person = null;
        PersistentLogin login = null;
        List<GrantedAuthority> authorities = null;
        try
        {
            person = personMapper.findByAccountId(username);
            login = (loginRepository == null) ? null : loginRepository.getPersistentLogin(username);
View Full Code Here

Examples of org.eurekastreams.server.domain.PersistentLogin

     * @param login
     *            The current PersistentLogin to be stored.
     */
    public void createOrUpdate(final PersistentLogin login)
    {
        PersistentLogin original = findByAccountId(login.getAccountId().toLowerCase());

        if (original == null)
        {
            insert(login);
        }
        else
        {
            original.setTokenValue(login.getTokenValue());
            original.setTokenExpirationDate(login.getTokenExpirationDate());
            flush();
        }
    }
View Full Code Here

Examples of org.eurekastreams.server.domain.PersistentLogin

                (getUserDetailsService().loadUserByUsername(cookieTokens[0]));

        //if no persistentLogin info returned from UserDetailsService, abort
        //as cookie was misleading or manually invalidated.
       
        PersistentLogin login = userDetails.getPersistentLogin();
       
        if (login == null)
        {
            throw new InvalidCookieException(
                    "No PersistentLogin record in repository");
        }

        // Check signature of token matches remaining details.
        // Must do this after user lookup,
        String expectedTokenSignature = login.getTokenValue();
        long expectedExpiryDate = login.getTokenExpirationDate();

        if (tokenExpiryTime != expectedExpiryDate)
        {
            throw new InvalidCookieException(
                    "Cookie token[1] contained expirationDate '"
View Full Code Here

Examples of org.eurekastreams.server.domain.PersistentLogin

        // exceptions and log it. If for any reason this doesn't work, abort
        // without
        // exception and don't set cookie
        try
        {
            PersistentLogin login = new PersistentLogin(username, signatureValue, expiryTime);
            loginRepository.createOrUpdatePersistentLogin(login);
        }
        catch (Exception e)
        {
            logger.error("Unable to insert PersistentLogin information to DB for user: "
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.