Package org.zeroexchange.model.user

Examples of org.zeroexchange.model.user.OpenIdCredential


     */
    @Override
    @Transactional
    public UserDetails loadUserByUsername(String userOpenId)
            throws UsernameNotFoundException, DataAccessException {
        OpenIdCredential credential = openIDCredentialDAO.findCredential(userOpenId);
        if(credential == null) {
            User newUser = userFactory.createNewUser();
           
            newUser.setDisplayName(userOpenId);
               
            credential = new OpenIdCredential();
            credential.setOpenIdIdentifier(userOpenId);
            newUser = userWriter.createUser(newUser);
            credentialsWriter.addCredential(newUser, credential);
        }   
        User user = credential == null ? null : credential.getUser();
        if(user == null) {
            throw new BusinessLogicException("Cannot obtain user by specified openId:" + userOpenId);
        }
        return new ZEUserDetails(Collections.<GrantedAuthority>singletonList(
                new GrantedAuthorityImpl(Role.ACEGITOKEN_USER)), user, credential);
View Full Code Here


     */
    @Override
    public OpenIdCredential findCredential(String openId) {
        Criteria crit = getSession().createCriteria(OpenIdCredential.class);
        crit = crit.add(Restrictions.eq(OpenIdCredential.FIELD_OPENIDIDENTIFIER, openId));
        OpenIdCredential credential = (OpenIdCredential) crit.uniqueResult();
        return credential;
    }
View Full Code Here

TOP

Related Classes of org.zeroexchange.model.user.OpenIdCredential

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.