I followed this tutorial on trying to authenticate my users to my REST API, everything works and my principal returns my name, but I don't seem to get any of the other data (email, friends list etc inside the scope). How do I do this using spring?
Yaml configuration file:
security:
oauth2:
client:
clientId: CENSORED
clientSecret: CENSORED
accessTokenUri: https://graph.facebook.com/oauth/access_token
userAuthorizationUri: https://www.facebook.com/dialog/oauth
tokenName: oauth_token
authenticationScheme: query
clientAuthenticationScheme: form
scope: email,user_friends,public_profile
resource:
userInfoUri: https://graph.facebook.com/me
user:
password: password
spring:
social:
facebook:
app-id: CENSORED
app-secret: CENSORED
RestController:
@RestController
public class UserController {
@RequestMapping(value = "/user", method = RequestMethod.GET)
public Principal user(FixedPrincipalExtractor extractor, Principal principal) {
return principal;
}
}
I need this information since I want to be able to mail my users, and also see if other 'friends' also use this application.
Thanks in advance! Please ask if something is unclear.
(I use maven as a package manager, with spring security as the authentication for my RESTFul API Which should connect to my AngularJS frontend || I'm new to Spring, I usually build REST API's using JAX-RS)