-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Add Multi-factor Authentication Support #17775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a399b9f
to
a69e16f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @jzheaux! I've provided feedback inline.
.../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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are very close now. I've provided feedback inline. In addition, can you please log a ticket to provide static constants for common factors?
...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
Merged in 28aad88 |
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_PASSWORD
andFACTOR_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
defaultAuthenticationEntryPointFor
in this PR. The above is needed for WebAuthn since it doesn't expose a custom entry point page in its DSL.