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
Default Log In Page should always be generic message #16484
The error message on the default log in pages should always be a generic message so that it does not have any information leakage when AuthenticationException.message includes details about the failure. To help developers, we should also ensure that the failure is logged at the debug level (likely in the AuthenticationManager so that it happens for all failures).
Can DefaultLoginPageGeneratingFilter.getLoginErrorMessage() be updated for generic messages in login pages? This method returns a Local message for AuthenticationException types but "Invalid credentials" for others. If we can localize the generic message say Bad credentials will that be useful?
The DEBUG messages can be logged at ProviderManager?
We can even log the error at OneTimeTokenAuthenticationProvider and re-throw the exception as BadCredentialsException (Refer PR)
We can even log the error at OneTimeTokenAuthenticationProvider and re-throw the exception as BadCredentialsException
Good idea, @Tejas-Teju, please go ahead an just focus on ProviderManager and DefaultLoginPageGeneratingFilter, though, for this ticket. And would you mind creating a separate ticket to improve logging in One-Time Token? That way we can review that entire feature holistically.
Activity
Tejas-Teju commentedon Jan 31, 2025
Hi @rwinch
Can you assign this issue to me? I will work on this
jzheaux commentedon Feb 3, 2025
Thanks, @Tejas-Teju! Looking forward to another PR from you.
Tejas-Teju commentedon Feb 6, 2025
@jzheaux
Need your inputs
Can
DefaultLoginPageGeneratingFilter.getLoginErrorMessage()be updated for generic messages in login pages? This method returns aLocalmessage for AuthenticationException types but"Invalid credentials"for others. If we can localize the generic message sayBad credentialswill that be useful?The
DEBUGmessages can be logged atProviderManager?We can even log the error at
OneTimeTokenAuthenticationProviderand re-throw the exception as BadCredentialsException (Refer PR)jzheaux commentedon Feb 7, 2025
The change is to not check for an exception message. Because of that, the answer is always "Invalid Credentials". That means this:
should be able to change to:
and
getLoginErrorMessageshould not be necessary anymore.The format for failure logs that we usually follow is:
For example,
As for
Provider Manager, I'd probably have a generic message like:for the end and a more contextual message for the
AccountStatusExceptionandInternalAuthenticationServiceExceptioncatchblock.jzheaux commentedon Feb 7, 2025
Good idea, @Tejas-Teju, please go ahead an just focus on
ProviderManagerandDefaultLoginPageGeneratingFilter, though, for this ticket. And would you mind creating a separate ticket to improve logging in One-Time Token? That way we can review that entire feature holistically.Tejas-Teju commentedon Feb 10, 2025
Thanks @jzheaux
There was a test case for getting the error message in
KOREA; hence, I thought we'll have to render the message inLocallanguage.Sure, I'll raise a separate ticket for logging.
Add debug messages for auth exceptions in ProviderManager
Add debug messages for auth exceptions in ProviderManager
Return Invalid Credentials message on login error
Add debug messages for auth exceptions in ProviderManager
Add debug messages for auth exceptions in ProviderManager
Polish Debug Messages
Return Invalid Credentials message on login error
jzheaux commentedon Feb 18, 2025
Superceded by #16575
Update Asserted Login Page Error Message
Update Asserted Login Page Error Message