You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
does not take into account ServerHttpSecurity.this.securityContextRepository (which has the same default value, but can be customized by invoking securityContextRepository()) and blindly creates a new instance of WebSessionServerSecurityContextRepository.
The JavaDoc for ServerHttpSecurity#securityContextRepository states:
It does not impact how the {@code SecurityContext} is saved which is configured on a per {@link AuthenticationWebFilter} basis
The way that HttpBasicSpec and FormLoginSpec are configured is as follows:
http
.httpBasic()
.securityContextRepository(...)
and
http
.formLogin()
.securityContextRepository(...)
Given the JavaDoc and the way that other authentication mechanisms work, it would seem to be preferable instead to add a securityContextRepository method to the oauth2Login DSL:
Activity
jzheaux commentedon Aug 8, 2019
The JavaDoc for
ServerHttpSecurity#securityContextRepositorystates:The way that
HttpBasicSpecandFormLoginSpecare configured is as follows:and
Given the JavaDoc and the way that other authentication mechanisms work, it would seem to be preferable instead to add a
securityContextRepositorymethod to theoauth2LoginDSL:Would you be willing to provide a PR along those lines instead? It would be one that introduces
securityContextRepository(...)toOAuth2LoginSpec.ilgrosso commentedon Aug 9, 2019
@jzheaux thanks for review; here's the new PR: #7244
Add support for oauth2Login().securityContextRepository(...)