REMESH KUMAR
REMESH KUMAR

Reputation: 11

How to get email using spring social plugin org.springframework.social.facebook.api.Facebook

I am able to access name using

facebook.userOperations().getUserProfile().getName()

But if i access the following code it returning null value

facebook.userOperations().getUserProfile().getEmail() 

Upvotes: 1

Views: 456

Answers (1)

Leon Radley
Leon Radley

Reputation: 7682

You need to specify the "email" scope.

Padd the scope to the /auth/facebook endpoint

th:href="@{/auth/facebook(scope='email')}"

Upvotes: 3

Related Questions