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
{{ message }}
Repository navigation
Expose all user-facing password policies to login themes
#55528
Since #32553, login themes get a passwordPolicies bean so they can show the user which password rules apply. It only knows a fixed list of policies, so some active rules are invisible to themes:
notContainsUsername
passwordAge (Not Recently Used, in days)
passwordBlacklist
regexPattern
any policy from a custom PasswordPolicyProviderFactory
A realm with notContainsUsername, for example, rejects a password for a rule the theme cannot mention. The realm bean doesn't expose the password policy either, so today a theme can only get at this through a custom LoginFormsProvider extension.
Proposal
Extend PasswordPoliciesBean:
notContainsUsername, passwordDenylist and regexPattern as booleans. Only whether the policy is active is exposed: the denylist value is a file name on the server, and a raw regex is no help to users.
passwordAge as a number, like passwordHistory.
hasPolicy(id) for any policy id, including custom providers.
The change is additive and limited to the bean. Existing templates keep working.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
Since #32553, login themes get a
passwordPoliciesbean so they can show the user which password rules apply. It only knows a fixed list of policies, so some active rules are invisible to themes:notContainsUsernamepasswordAge(Not Recently Used, in days)passwordBlacklistregexPatternPasswordPolicyProviderFactoryA realm with
notContainsUsername, for example, rejects a password for a rule the theme cannot mention. The realm bean doesn't expose the password policy either, so today a theme can only get at this through a customLoginFormsProviderextension.Proposal
Extend
PasswordPoliciesBean:notContainsUsername,passwordDenylistandregexPatternas booleans. Only whether the policy is active is exposed: the denylist value is a file name on the server, and a raw regex is no help to users.passwordAgeas a number, likepasswordHistory.hasPolicy(id)for any policy id, including custom providers.The change is additive and limited to the bean. Existing templates keep working.
Draft: main...MartB:keycloak:fix-password-policies-bean
All reactions