Hi Dulanja,

Thanks for the info.

Regards,

Lakshitha Harshan
Software Engineer
Mobile: *+94724423048*
Email: [email protected]
Blog : http://harshanliyanage.blogspot.com/
*WSO2, Inc. :** wso2.com <http://wso2.com/>*
lean.enterprise.middleware.

On Mon, May 25, 2015 at 10:45 PM, Dulanja Liyanage <[email protected]> wrote:

> Hi Harshan,
>
> That's not the only usage of that variable. JSP at [1] is included by the
> login.jsp.
>
> [1]
> https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/identity/org.wso2.carbon.identity.application.authentication.endpoint/4.2.2/src/main/webapp/basicauth.jsp
>
> Thanks,
> Dulanja
>
> On Mon, May 25, 2015 at 12:15 PM, Harshan Liyanage <[email protected]>
> wrote:
>
>> Hi,
>>
>> I've encountered the following code block while going through the source
>> of authentication endpoint [1]. There is a String variable ("loginFailed")
>> which is used for holding boolean values as Strings.
>>
>> String errorMessage = "Authentication Failed! Please Retry";
>>         String loginFailed = "false";
>>
>>         if (request.getParameter(Constants.AUTH_FAILURE) != null &&
>>                 "true".equals(request.getParameter(Constants.AUTH_FAILURE))) 
>> {
>>             loginFailed = "true";
>>
>>             if(request.getParameter(Constants.AUTH_FAILURE_MSG) != null){
>>                 errorMessage = (String) 
>> request.getParameter(Constants.AUTH_FAILURE_MSG);
>>
>>                 if (errorMessage.equalsIgnoreCase("login.fail.message")) {
>>                     errorMessage = "Authentication Failed! Please Retry";
>>                 }
>>             }
>>         }
>>
>> I've checked for its usages in login.jsp. But only found one occurrence as 
>> given below.
>>
>> <%if(localAuthenticatorNames.contains("CustomBasicAuthenticator")){ %>
>>
>>     <div id="local_auth_div" class="container main-login-container" 
>> style="margin-top:10px;">
>>
>> <%} %>
>>
>>
>>              <% if ("true".equals(loginFailed)) { %>
>>
>>             <div class="alert alert-error">
>>
>>                 <%=errorMessage%>
>>
>>             </div>
>>
>>          <% } %>
>>
>> Is there any particular reason for not using a boolean variable instead of 
>> String variable  "loginFailed" variable?
>>
>> [1].
>> https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/identity/org.wso2.carbon.identity.application.authentication.endpoint/4.2.2/src/main/webapp/login.jsp
>>
>> Thanks,
>>
>> Lakshitha Harshan
>> Software Engineer
>> Mobile: *+94724423048*
>> Email: [email protected]
>> Blog : http://harshanliyanage.blogspot.com/
>> *WSO2, Inc. :** wso2.com <http://wso2.com/>*
>> lean.enterprise.middleware.
>>
>
>
>
> --
> Thanks & Regards,
> Dulanja Liyanage
> WSO2 Inc.
> M: +94776764717
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to