title: How to Register through facebook using Spring Social
body: <p>I am new to Spring Social. I am working on java Spring Social application in which i want to be able to register through facebook. can anyone please respond with example to achieve it?</p>
  
  <p>In Spring Controller callback method</p>
  
  <pre><code>@RequestMapping(value = "/callback", method = RequestMethod.GET)
      @ResponseBody
      public String postOnWall(@RequestParam("code") String code,
              @RequestParam("state") String state, HttpServletRequest request,
              HttpServletResponse response) throws Exception {
  
          System.out.println("hi welcome to callback method");
  
          OAuthService oAuthService = facebookServiceProvider.getService();
  
          Verifier verifier = new Verifier(code);
          Token accessToken = oAuthService
                  .getAccessToken(Token.empty(), verifier);
  //      Token accessToken = new Token("EAADOe1JXBWgBAJVtLpGKTM6pol0n8r8fZAHnEPmNZCnId9419k9EHj2scdtcZBotMW5oYneKTvY93ZASRpeUGLiXRKhWvuZBA3zfEgIjGpvLMZCzODvA3SuNm9glARg0c5puZARVuTyZAiSqibD76taIUk06O08lOSm2vJDufCAlUdIP8P9c4ZBLP", "", "");
          System.out.println("accessToken "+accessToken);
  
          FacebookTemplate template = new FacebookTemplate(accessToken.getToken());
          System.out.println(template.isAuthorized()+" autherized or not condition");
          FacebookProfile facebookProfile = template.userOperations()
                  .getUserProfile();
          System.out.println("user permissions "+template.userOperations().getUserPermissions());
  
          String userId = facebookProfile.getId();
  
          System.out.println("user about "+facebookProfile.getAbout());
  
          LOGGER.info("Logged in User Id : {}", userId);
  
          MultiValueMap&lt;String, Object&gt; map = facebookUtil
                  .publishLinkWithVisiblityRestriction(state);
          try {
              template.publish(facebookProfile.getId(), "feed", map);
          } catch (Exception ex) {
              LOGGER.error(
                      "Exception Occurred while posting a link on facebook for user Id : {}, exception is : {}",
                      userId, ex);
              return PUBLISH_ERROR;
          }
  
          return PUBLISH_SUCCESS;
      }
  </code></pre>
  
  <p>In above method  i am getting all parameters (like email, first name, about etc) as null </p>