Search in sources :

Example 6 with UserProfile

use of org.springframework.social.connect.UserProfile in project dubion by valsamiq.

the class SocialService method createSocialUser.

public void createSocialUser(Connection<?> connection, String langKey) {
    if (connection == null) {
        log.error("Cannot create social user because connection is null");
        throw new IllegalArgumentException("Connection cannot be null");
    }
    UserProfile userProfile = connection.fetchUserProfile();
    String providerId = connection.getKey().getProviderId();
    String imageUrl = connection.getImageUrl();
    User user = createUserIfNotExist(userProfile, langKey, providerId, imageUrl);
    createSocialConnection(user.getLogin(), connection);
    mailService.sendSocialRegistrationValidationEmail(user, providerId);
}
Also used : User(com.dubion.domain.User) UserProfile(org.springframework.social.connect.UserProfile)

Aggregations

UserProfile (org.springframework.social.connect.UserProfile)6 User (com.dubion.domain.User)1 User (com.furyviewer.domain.User)1 Customer (org.broadleafcommerce.profile.core.domain.Customer)1 Profile (org.craftercms.profile.api.Profile)1 AccessGrant (org.springframework.social.oauth2.AccessGrant)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 ServletWebRequest (org.springframework.web.context.request.ServletWebRequest)1