Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring Social + Spring Security HTTPS/HTTP
    primarykey
    data
    text
    <p>How can I make the remember me cookie and session accessible through http when requesting a facebook login from either http or https with spring social. Currently if a user logs in through https the cookie is not readable through http pages (no user logged in). I am using use-secure-cookie="false" but that doesn't help.</p> <pre><code> &lt;s:remember-me key="mykey" services-ref="rememberMeServices" use-secure-cookie="false"/&gt; &lt;bean id="rememberMeServices" class="org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices"&gt; &lt;property name="userDetailsService" ref="userService" /&gt; &lt;property name="tokenRepository" ref="persistentTokenRepository" /&gt; &lt;property name="key" value="mykey" /&gt; &lt;property name="cookieName" value="rmb" /&gt; &lt;property name="useSecureCookie" value="false" /&gt; &lt;property name="tokenValiditySeconds" value="946708560" /&gt; &lt;property name="alwaysRemember" value="true"&gt;&lt;/property&gt; &lt;/bean&gt; </code></pre> <p>My Social Config:</p> <pre><code>@Configuration public class SocialConfig { @Inject private Environment environment; @Inject private DataSource dataSource; @Inject private TextEncryptor textEncryptor; @Value("${app.url}") private String applicationUrl; @Value("${facebook.clientId}") private String facebookClientId; @Value("${facebook.clientSecret}") private String facebookClientSecret; @Bean public ConnectionFactoryLocator connectionFactoryLocator() { ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry(); registry.addConnectionFactory(new FacebookConnectionFactory( facebookClientId, facebookClientSecret)); return registry; } @Bean @Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES) public ConnectionRepository connectionRepository() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication == null) { throw new IllegalStateException("Unable to get a ConnectionRepository: no user signed in"); } return usersConnectionRepository().createConnectionRepository(authentication.getName()); } @Bean public UsersConnectionRepository usersConnectionRepository() { JdbcUsersConnectionRepository repository = new JdbcUsersConnectionRepository( dataSource, connectionFactoryLocator(), textEncryptor); repository.setConnectionSignUp(connectionSignUp()); return repository; } @Bean public TextEncryptor textEncryptor() { return Encryptors.noOpText(); } @Bean public ConnectController connectController() { ConnectController controller = new ConnectController( connectionFactoryLocator(), connectionRepository()); controller.setApplicationUrl(applicationUrl); return controller; } @Bean public ProviderSignInController providerSignInController(RequestCache requestCache) { ProviderSignInController controller = new ProviderSignInController(connectionFactoryLocator(), usersConnectionRepository(), signInAdapter()); controller.setSignUpUrl("/register"); controller.setSignInUrl("/socialSignIn"); controller.setPostSignInUrl("socialSignIn"); controller.addSignInInterceptor(new RedirectAfterConnectInterceptor()); return controller; } @Bean public SignInAdapter signInAdapter() { return new SignInAdapterImpl(); } @Bean public ConnectionSignUp connectionSignUp() { return new ConnectionSignUpImpl(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload