[ 
https://issues.apache.org/jira/browse/SHIRO-415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13569720#comment-13569720
 ] 

Salih Cenap Baydar commented on SHIRO-415:
------------------------------------------

You are welcome.. :-)
                
> isLoginAttempt method in BasicHttpAuthenticationFilter class fails if used in 
> any locale other than English
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: SHIRO-415
>                 URL: https://issues.apache.org/jira/browse/SHIRO-415
>             Project: Shiro
>          Issue Type: Bug
>          Components: Realms 
>    Affects Versions: 1.2.1
>         Environment: Eclipse, netbeans, windows 7 Turkish
>            Reporter: Salih Cenap Baydar
>            Priority: Minor
>              Labels: i18n
>             Fix For: 1.2.2
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In isLoginAttempt method in BasicHttpAuthenticationFilter class fails if used 
> in any locale other than English. This happens because at the line String 
> authzScheme = getAuthzScheme().toLowerCase(); , the toLowerCase methods takes 
> i18n into consideration. If the locale of the host is Turkish the string 
> "BASIC" becomes "basıc" but not "basic" (there is the letter "ı" -lowercase i 
> without the dot-  in Turkish) So the comparison returns false. The method 
> fails.
> The solution is pretty easy:
> The two lines of the method "isLoginAttempt" in BasicHttpAuthenticationFilter 
> class should be changed as below to make sure it works always the same:
>     protected boolean isLoginAttempt(String authzHeader) {
>         String authzScheme = getAuthzScheme().toLowerCase(Locale.ENGLISH);
>         return 
> authzHeader.toLowerCase(Locale.ENGLISH).startsWith(authzScheme);
>     }  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to