Question

I've integrated Spring Social with an MVC webapp, using Facebook to begin with. When the user logs in they are always taken to /signin (despite the fact the login page is /login). How do I specify the page they should be taken to? And is it possible to do this dynamically?

I've tried:

ProviderSignInController psc = new ProviderSignInController(    connectionFactoryLocator(), usersConnectionRepository(), new SimpleSignInAdapter());

psc.setPostSignInUrl("/");

But it doesn't appear to have any affect. For the time being I'm just redirecting:

@RequestMapping({"/signin"})
public String signin(ModelMap model, HttpServletRequest httpReq) 
{
    return "redirect:/";
} 
Was it helpful?

Solution 2

The problem was that I wasn't returning null from the SignInAdapter method signIn. You have to return null there for ProviderSignInController to use postSignInUrl.

I've written my own social controller based on ProviderSignInController now, which works better for me.

OTHER TIPS

To be clear, which version of Spring Social are you using? I fixed a bug related to this prior to the 1.1.0 release, so if you're still using 1.0.x, then you can upgrade to get the fix. If you're experiencing this with 1.1.0, then it looks like I have more work to do. If so, could you please open a bug issue at https://jira.springsource.org/browse/SOCIAL. Thanks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top