Did not find SecurityContext in HttpSession xxxx using the SPRING_SECURITY_CONTEXT session attribute #224
Description
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