I'm using spring-social-google (built from the git repo) to allow people to sign into my Spring MVC application (I already have facebook, twitter and linedin working). The form below allows me to authenticate, but an email address is not returned and posting to the Google+ timeline is prohibited:
<form action="<c:url value="/register/social/${providerId}" />" method="POST" id ="${providerId}Form" name = "${providerId}Form">
<button type="submit"><img src="<c:url value='/resources/${providerId}/sign-in-with-${providerId}.png'/>" border="0"/></button>
<input type="hidden" name="scope" value="https://www.googleapis.com/auth/plus.profile.emails.read" />
</form>
I think the issue is that I don't have the correct scope variables. I've tried some of the combinations here https://developers.google.com/+/api/oauth but I get told that the scope variables are all wrong. Which ones do I need?
This is the code for I'm using to get the email address:
public final class LoginConnectionSignUp implements ConnectionSignUp
{
public String execute(Connection<?> connection)
{
final UserProfile up = connection.fetchUserProfile();
final String email = up.getEmail();
// ...
}
}