2

I need to display the facebook social login in a popup window.

In order that facebook login dialog is displayed with minimal decoration, I want to add the facebook parameter display=popup.

But I'm not using Spring Social's ConnectController - in that case I could add the parameter via an interceptor.

Instead I'm using Spring Social's SocialAuthenticationFilter. How can I add display=popup in this scenario?

olivmir
  • 692
  • 10
  • 29

1 Answers1

0

If you post some code which you use to implement authentication via Facebook, that would help. We're using Spring Social to provide "login via Facebook functionality" for our website. There is related code:

ConnectionFactory connectionFactory = connectionFactoryLocator.getConnectionFactory(providerType);
Method getOAuthOperationsMethod = connectionFactory.getClass().getMethod("getOAuthOperations");
Object oauthOperations = getOAuthOperationsMethod.invoke(connectionFactory);
OAuth2Parameters params = new OAuth2Parameters();
params.setRedirectUri("your redirect URL");
params.setScope("email");
params.put("display", Collections.singletonList("popup"));
params.setState(state);
authorizeUrl = ((OAuth2Operations) oauthOperations).buildAuthorizeUrl(GrantType.AUTHORIZATION_CODE, params);
return "redirect:" + authorizeUrl;

authorizeUrl yields string which looks like this:

https://www.facebook.com/v2.5/dialog/oauth?client_id=1234&response_type=code&redirect_uri=http%3A%2F%2Fwww.company.com%2Fcallback&scope=email&display=popup&state=8fb43b90-be0f-4d3d-9ee6-8cb1641f08b5

izogfif
  • 6,000
  • 2
  • 35
  • 25