org.springframework.social.google.api.Google Java Examples

The following examples show how to use org.springframework.social.google.api.Google. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GooglePlusController.java    From OAuth-2.0-Cookbook with MIT License 5 votes vote down vote up
@GetMapping
public String profile(Model model) {
	if (connectionRepository.findPrimaryConnection(Google.class) == null) {
		return "redirect:/connect/google";
	}

	String name = google.plusOperations().getGoogleProfile()
		.getDisplayName();
	model.addAttribute("name", name);

	return "profile";
}
 
Example #2
Source File: GoogleConfigurerAdapter.java    From OAuth-2.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Google google(final ConnectionRepository repository) {
	final Connection<Google> connection = repository
			.findPrimaryConnection(Google.class);
	return connection != null ? connection.getApi() : null;
}
 
Example #3
Source File: GoogleProviderConfig.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected ConnectInterceptor<Google> getConnectInterceptor() {	
      if( googleConnectInterceptor == null ) {
               googleConnectInterceptor = new GoogleConnectInterceptor();
       }
       return googleConnectInterceptor;
}
 
Example #4
Source File: GoogleProviderConfig.java    From AIDR with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected ConnectInterceptor<Google> getConnectInterceptor() {	
      if( googleConnectInterceptor == null ) {
               googleConnectInterceptor = new GoogleConnectInterceptor();
       }
       return googleConnectInterceptor;
}
 
Example #5
Source File: GoogleProviderConfig.java    From AIDR with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
protected ConnectionFactory<Google> createConnectionFactory() {
	GoogleConnectionFactory googleConnectionFactory = new GoogleConnectionFactory(googleConsumerKey, googleConsumerSecret);
	googleConnectionFactory.setScope("email");
	return googleConnectionFactory;
}
 
Example #6
Source File: GoogleProviderConfig.java    From AIDR with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
protected ConnectionFactory<Google> createConnectionFactory() {
	GoogleConnectionFactory googleConnectionFactory = new GoogleConnectionFactory(googleConsumerKey, googleConsumerSecret);
	googleConnectionFactory.setScope("email");
	return googleConnectionFactory;
}
 
Example #7
Source File: SocialConfig.java    From JiwhizBlogWeb with Apache License 2.0 4 votes vote down vote up
@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Google google(ConnectionRepository repository) {
    Connection<Google> connection = repository.findPrimaryConnection(Google.class);
    return connection != null ? connection.getApi() : new GoogleTemplate();
}