spring-projects / spring-projects/spring-session

Spring Session is null after oauth success callback

Open
#827 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
1.9k
Forks
1.2k
Avg merge
4h 27m
Merged PRs (30d)
55

Description

Hi guys,

I am using following configuration for a Spring Microservices application:

  1. Spring Session (Backed by Redis Server)
  2. Form login
  3. Social Login (Facebook + Twitter ) using spring-social plugin.

Form Login is working fine with both HttpSession as well as SpringSession using Redis.

In case of Social Login, SpringSession is always null. When I use HttpSession it works fine.

I am using following configuration to enable SpringSession:

@EnableRedisHttpSession
public class SpringSessionConfig {

    @Bean
    public LettuceConnectionFactory connectionFactory() {
            return new LettuceConnectionFactory(); 
    }

    @Bean
    public HttpSessionStrategy httpSessionStrategy() {
            return new HeaderHttpSessionStrategy(); 
    }

} 
@Configuration
public class SpringSessionFilterInitializer extends AbstractHttpSessionApplicationInitializer {

    public SpringSessionFilterInitializer() {
        super(SpringSessionConfig.class);
    }

}

Can Anyone help me in getting the right direction?

Thanks in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SpringSessionConfig and SpringSessionFilterInitializer configuration shown in the issue, then reproduce the social-login callback using Redis-backed Spring Session. Compare its session handling with the working form-login and HttpSession paths. Done means the session remains available after the Facebook or Twitter OAuth success callback.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis, spring
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.