[
https://issues.apache.org/jira/browse/RANGER-3672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17511080#comment-17511080
]
kirby zhou commented on RANGER-3672:
------------------------------------
CLIUtil.java problem.
It is intend to be used by CLI not by Webserver.
Locale.getDefault() is the default locale of server console, but not the
preferred locale by HTTP request (HTTP HEADER Accept-Language).
RangerAuthFailureHandler should not return messages
{code:java}
public static String getMessage(String messagekey,HttpServletRequest request){
ServletContext servletContext = request.getSession().getServletContext();
ApplicationContext ctx =
WebApplicationContextUtils.getWebApplicationContext(servletContext);
Object[] args = new Object[] {};
String messageValue=ctx.getMessage(messagekey, args, Locale.getDefault());
return messageValue;
}
{code}
RangerAuthFailureHandler should not rely on CLIUtil when returning information
to WebUI.
> Show better error messages during failed logins
> -----------------------------------------------
>
> Key: RANGER-3672
> URL: https://issues.apache.org/jira/browse/RANGER-3672
> Project: Ranger
> Issue Type: Improvement
> Components: admin
> Affects Versions: 3.0.0, 2.3.0
> Reporter: kirby zhou
> Assignee: Bhavik Patel
> Priority: Critical
> Attachments:
> 0001-RANGER-3672-Show-better-error-messages-during-failed.patch,
> image-2022-03-23-09-08-15-529.png, image-2022-03-23-10-16-29-335.png,
> 截屏2022-03-21 12.07.03.jpg
>
>
> When login failure, There are no conspicuous error tips and reasons, just a
> small red triangle. Should give user a big error prompt box, tell him "The
> username or password you entered is incorrect..", "The user is disabled or
> locked for too many attempts. Try again 5 minutes later".
>
> It seems RANGER-375 did some works before. But I can not see the text message
> now.
>
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)