Search in sources :

Example 1 with ConnectionRepository

use of org.springframework.social.connect.ConnectionRepository in project ORCID-Source by ORCID.

the class SocialContext method isConnectedGoogleUser.

private boolean isConnectedGoogleUser(String userId) {
    ConnectionRepository connectionRepo = connectionRepository.createConnectionRepository(userId);
    Connection<Google> googleConnection = connectionRepo.findPrimaryConnection(Google.class);
    return googleConnection != null;
}
Also used : Google(org.springframework.social.google.api.Google) ConnectionRepository(org.springframework.social.connect.ConnectionRepository) UsersConnectionRepository(org.springframework.social.connect.UsersConnectionRepository)

Example 2 with ConnectionRepository

use of org.springframework.social.connect.ConnectionRepository in project ORCID-Source by ORCID.

the class SocialContext method isConnectedFacebookUser.

private boolean isConnectedFacebookUser(String userId) {
    ConnectionRepository connectionRepo = connectionRepository.createConnectionRepository(userId);
    Connection<Facebook> facebookConnection = connectionRepo.findPrimaryConnection(Facebook.class);
    return facebookConnection != null;
}
Also used : ConnectionRepository(org.springframework.social.connect.ConnectionRepository) UsersConnectionRepository(org.springframework.social.connect.UsersConnectionRepository) Facebook(org.springframework.social.facebook.api.Facebook)

Aggregations

ConnectionRepository (org.springframework.social.connect.ConnectionRepository)2 UsersConnectionRepository (org.springframework.social.connect.UsersConnectionRepository)2 Facebook (org.springframework.social.facebook.api.Facebook)1 Google (org.springframework.social.google.api.Google)1