Skip to content

Add unless support to AdditionalRequiredFactorsBuilder#18939

Open
therepanic wants to merge 1 commit intospring-projects:mainfrom
therepanic:gh-18925
Open

Add unless support to AdditionalRequiredFactorsBuilder#18939
therepanic wants to merge 1 commit intospring-projects:mainfrom
therepanic:gh-18925

Conversation

@therepanic
Copy link
Contributor

In this commit, we are adding support for 'unless' to 'AdditionalRequiredFactorsBuilder'. This is useful if we want a specific user type or factor to disable MFA.

Closes: gh-18925

In this commit, we are adding support for 'unless' to
'AdditionalRequiredFactorsBuilder'. This is useful if we want a specific
user type or factor to disable MFA.

Closes: spring-projectsgh-18925

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
Comment on lines +117 to +124
/**
* Customize the condition that determines if the required factors are skipped.
* @param condition a function that takes the current condition and returns the
* new condition
* @return the {@link AdditionalRequiredFactorsBuilder} to further customize
* @since 7.1
*/
public AdditionalRequiredFactorsBuilder<T> withUnless(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, we'll add this method (since there's withWhen)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Disabling MFA when the User has a Specified Authority

2 participants