title: Retrieve facebook email address using spring security
body: <p>I followed <a href="https://spring.io/blog/2015/02/03/sso-with-oauth2-angular-js-and-spring-security-part-v" rel="nofollow noreferrer">this</a> 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? </p>
  
  <p>Yaml configuration file: </p>
  
  <pre><code>    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
  </code></pre>
  
  <p>RestController: </p>
  
  <pre><code>    @RestController
  public class UserController {
  
      @RequestMapping(value = "/user", method = RequestMethod.GET)
      public Principal user(FixedPrincipalExtractor extractor, Principal principal)   {
  
          return principal;
      }
  }
  </code></pre>
  
  <p>I need this information since I want to be able to mail my users, and also see if other 'friends' also use this application. </p>
  
  <p>Thanks in advance! Please ask if something is unclear. </p>
  
  <p>(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)  </p>