Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Did not find SecurityContext in HttpSession xxxx using the SPRING_SECURITY_CONTEXT session attribute #224

Open
casper5822 opened this issue Dec 19, 2022 · 1 comment

Comments

@casper5822
Copy link

casper5822 commented Dec 19, 2022

Expected behavior

Store the security context after redirect to target uri from oauth2/authorize endpoint

Actual behavior

The security context is lost when redirect to login form from oauth2/authorize endpoint
The error is:

Did not find SecurityContext in HttpSession f911c965-141f-4880-9518-a316c05cd1c9 using the SPRING_SECURITY_CONTEXT session attribute

Steps to reproduce

Just try the new oauth2-authorization-server with spring security 5 and spring boot 3.
Create the formLogin() to protect the oauth2/authorize enpoint and try to make the login with the authentication_code PKCE flow.

Just follow this tutorial:

https://www.youtube.com/watch?v=DaUGKnA7aro&t=1791s&ab_channel=SpringI%2FO

Reactor Netty version

JVM version (e.g. java -version)

openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment (build 17.0.5+8-Ubuntu-2ubuntu122.04)
OpenJDK 64-Bit Server VM (build 17.0.5+8-Ubuntu-2ubuntu122.04, mixed mode, sharing)

OS version (e.g. uname -a)

Linux 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

@casper5822 casper5822 changed the title Did not find SecurityContext in HttpSessionusing the SPRING_SECURITY_CONTEXT session attribute Did not find SecurityContext in HttpSession using the SPRING_SECURITY_CONTEXT session attribute Dec 19, 2022
@casper5822 casper5822 changed the title Did not find SecurityContext in HttpSession using the SPRING_SECURITY_CONTEXT session attribute Did not find SecurityContext in HttpSession xxxx using the SPRING_SECURITY_CONTEXT session attribute Dec 19, 2022
@AlexGreg
Copy link

this is happening to me too

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants