title: Spring social login and redirect and return value
body: <p>I am testing Spring Social Showcase and I wrote a similar application. While the Spring Social Showcase is a simple HTML application written using Spring MVC, my app is using angularjs and AJAX. There is a problem with redirection after access token is accepted by Twitter or Facebook.</p>
  
  <p>In my flow, first I change the setting for <code>ProviderSignInController</code>:</p>
  
  <pre><code>providerSignInController.setSignUpUrl("/register/social"); &lt;-- redirect into my controller
  </code></pre>
  
  <p>then there's my controller: </p>
  
  <pre><code>@RequestMapping(value="/social" ,method=RequestMethod.GET)
      public ModelAndView social(WebRequest request, ){
          LOG.info("Register new user using social info");
          Connection&lt;?&gt; connection = ProviderSignInUtils.getConnection(request);
  
          if(connection != null){
              LOG.info("User has been authorize from  " + connection.getKey().getProviderId());
              LOG.info("Connection class: " + connection.getClass());
              model.addAttribute("socialUser",RegisterUserDto.fromSocialProfile(connection.fetchUserProfile()) );
          }else{
  
          }
  
          return new ModelAndView("redirect:http://localhost:8080/turnigo-core-web/#/register");
      }
  </code></pre>
  
  <p>This controller is only redirecting me back to the website with the registration form, but I haven't got any user profile data from the social provider. The simple redirect is working fine, but it's not enough for my app. :/</p>
  
  <p>I haven't got any idea how I can fix it, so here are my questions:</p>
  
  <ol>
  <li><p>It is possible to open social authentication website in another webpage, then close it and return to previous page with user profile data? </p></li>
  <li><p>Are there any examples with AJAX application using Spring Social login? </p></li>
  </ol>