Package models.auth

Examples of models.auth.LinkItAccount


    @Test public void delete() {
        Member member = createMember("member");
        // Some accounts
        member.addAccount(new GoogleAccount("1234"));
        member.addAccount(new TwitterAccount("member"));
        member.authenticate(new LinkItAccount("password"));
        member.authenticate(new GoogleOAuthAccount("token", "secret"));
        member.authenticate(new TwitterOAuthAccount("token", "secret"));
        // Some shared links
        member.addSharedLink(new SharedLink("Google", "http://www.google.com"));
        member.addSharedLink(new SharedLink("Yahoo", "http://www.yahoo.fr"));
View Full Code Here


        // Unknown user
        Member nouveau = Member.findByLogin(login);
        assertNull(nouveau);
       
        nouveau = new Member(login);
        nouveau.preregister(new LinkItAccount("password"));
        nouveau.register();
       
        // One activity for nouveau
        Activity a = Activity.find("select a from Activity a where a.member = ?", nouveau).first();
        assertActivity(a);
View Full Code Here

        if (Member.findByLogin(login) != null) {
            flash.error("Ce login est déjà utilisé");
            render(login, password);
        }
        Member member = new Member(login);
        member.preregister(new LinkItAccount(password));
        Profile.register(login, ProviderType.LinkIt);
    }
View Full Code Here

public class Security extends Secure.Security {

  public static final String ADMIN = "admin";

  public static boolean authenticate(String username, String password) {
    LinkItAccount account = (LinkItAccount) LinkItAccount.find(
        ProviderType.LinkIt, username);

    // Retrieve salt from configuration
    String salt = Play.configuration.get("application.salt").toString();
    String passwordHash = Crypto.passwordHash(password + salt, HashType.SHA256);
View Full Code Here

        // Unknown user
        Member nouveau = Member.findByLogin(login);
        assertNull(nouveau);
       
        nouveau = new Member(login);
        nouveau.preregister(new LinkItAccount(password));
        nouveau.register();
       
        assertFalse(Security.authenticate(login, "foo"));
        assertTrue(Security.authenticate(login,password));
    }
View Full Code Here

TOP

Related Classes of models.auth.LinkItAccount

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.