Add Multi-factor Authentication Support#17775
Closed
jzheaux wants to merge 9 commits intospring-projects:mainfrom
Closed
Add Multi-factor Authentication Support#17775jzheaux wants to merge 9 commits intospring-projects:mainfrom
jzheaux wants to merge 9 commits intospring-projects:mainfrom
Conversation
a399b9f to
a69e16f
Compare
rwinch
requested changes
Sep 11, 2025
.../springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurer.java
Outdated
Show resolved
Hide resolved
...main/java/org/springframework/security/config/annotation/web/configurers/X509Configurer.java
Outdated
Show resolved
Hide resolved
.../springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurer.java
Outdated
Show resolved
Hide resolved
.../springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurer.java
Outdated
Show resolved
Hide resolved
...ingframework/security/config/annotation/web/configurers/ott/OneTimeTokenLoginConfigurer.java
Outdated
Show resolved
Hide resolved
.../springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurer.java
Outdated
Show resolved
Hide resolved
.../springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurer.java
Outdated
Show resolved
Hide resolved
...g/springframework/security/authentication/dao/AbstractUserDetailsAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ava/org/springframework/security/ldap/authentication/AbstractLdapAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
.../springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurer.java
Outdated
Show resolved
Hide resolved
rwinch
requested changes
Sep 16, 2025
Member
rwinch
left a comment
There was a problem hiding this comment.
I've provided some additional feedback based upon your changes
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Outdated
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Outdated
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Outdated
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Outdated
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Outdated
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Outdated
Show resolved
Hide resolved
...ingframework/security/web/authentication/preauth/PreAuthenticatedAuthenticationProvider.java
Show resolved
Hide resolved
c123bb6 to
cd4c9d0
Compare
rwinch
requested changes
Sep 18, 2025
Member
rwinch
left a comment
There was a problem hiding this comment.
Thanks for the updates. I've provided some additional feedback inline
.../springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurer.java
Outdated
Show resolved
Hide resolved
.../springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurer.java
Outdated
Show resolved
Hide resolved
...main/java/org/springframework/security/config/annotation/web/configurers/X509Configurer.java
Outdated
Show resolved
Hide resolved
...main/java/org/springframework/security/config/annotation/web/configurers/X509Configurer.java
Show resolved
Hide resolved
core/src/main/java/org/springframework/security/core/GrantedAuthority.java
Outdated
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Show resolved
Hide resolved
...a/org/springframework/security/web/access/DelegatingMissingAuthorityAccessDeniedHandler.java
Outdated
Show resolved
Hide resolved
afaf6fc to
4283aeb
Compare
This commit hardcodes factors as a proof of concept for multi-factor authentication Issue spring-projectsgh-17934
- Moved request attribute to WebAttributes - Renamed ExceptionHandlingConfigurer methods - Removed varargs from DelegatingMissingAuthorityAccessDeniedHandler
rwinch
requested changes
Sep 22, 2025
...main/java/org/springframework/security/config/annotation/web/configurers/X509Configurer.java
Show resolved
Hide resolved
.../java/org/springframework/security/config/annotation/web/configurers/WebAuthnConfigurer.java
Show resolved
Hide resolved
Contributor
Author
|
Merged in 28aad88 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to spring-projects/spring-security-samples#351
Implement N authentication factors and they will be required in the order that they are declared:
This will ask for a username/password first and a one-time token second. Thereafter, the user will be considered sufficiently authenticated.
Note that you can also publish an
AuthorizationManagerFactory<Object>bean that checks forFACTOR_PASSWORDandFACTOR_OTT; however, this has not been added to this PR.You can also specify a custom action to perform when a given factor is missing:
Note that authentication factors already integrate with
defaultAuthenticationEntryPointForin this PR. The above is needed for WebAuthn since it doesn't expose a custom entry point page in its DSL.