Examples of GaeUser


Examples of cz.cvut.fel.wa2.interior.entity.GaeUser

    @Autowired
    private UserDAO userDAO;

    public void create(String email) {
        GaeUser user = new GaeUser("panekon1@gmail.com");
        userDAO.persist(user);
    }
View Full Code Here

Examples of cz.cvut.fel.wa2.interior.entity.GaeUser

        User user = (User) authentication.getPrincipal();
       // System.out.println("AUTHENTICATING " + user.getUsername());

        CustomAuthentication gaeAuthentication = new CustomAuthentication(user, authentication.getDetails());

        GaeUser googleUser = userService.findByEmail(user.getUsername());
        if (googleUser == null) {
        //    System.out.println("NOT AUTHENTICATED " + user.getUsername());
            gaeAuthentication.setAuthenticated(false);
        }
View Full Code Here

Examples of samples.gae.users.GaeUser

        if (result.hasErrors()) {
            return null;
        }

        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        GaeUser currentUser = (GaeUser)authentication.getPrincipal();
        Set<AppRole> roles = EnumSet.of(AppRole.USER);

        if (UserServiceFactory.getUserService().isUserAdmin()) {
            roles.add(AppRole.ADMIN);
        }

        GaeUser user = new GaeUser(currentUser.getUserId(), currentUser.getNickname(), currentUser.getEmail(),
                form.getForename(), form.getSurname(), roles, true);

        registry.registerUser(user);

        // Update the context with the full authentication
View Full Code Here

Examples of samples.gae.users.GaeUser

    private UserRegistry userRegistry;

    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
        User googleUser = (User) authentication.getPrincipal();

        GaeUser user = userRegistry.findUser(googleUser.getUserId());

        if (user == null) {
            // User not in registry. Needs to register
            user = new GaeUser(googleUser.getUserId(), googleUser.getNickname(), googleUser.getEmail());
        }

        if (!user.isEnabled()) {
            throw new DisabledException("Account is disabled");
        }

        return new GaeUserAuthentication(user, authentication.getDetails());
    }
View Full Code Here

Examples of samples.gae.users.GaeUser

        if (googleUser == null) {
            // User has logged out of GAE but is still logged into application
            return false;
        }

        GaeUser gaeUser = (GaeUser)authentication.getPrincipal();

        if (!gaeUser.getEmail().equals(googleUser.getEmail())) {
            return false;
        }

        return true;
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.