Menu

#89 malformed gatewayLoginErrorUrl

open
nobody
5
2008-02-25
2008-02-25
No

When I'm configuring the gatewayLoginErrorUrl like this:

<gatewayLoginErrorUrl>
http://server/login.action?act=loginError
</gatewayLoginErrorUrl>

I can't get josso_error_type due to a malformation in the URL.

The problem occurs in this piece of code in the LoginAction.java,

// Add error type and received username to ERROR URL.
on_error += on_error.indexOf("?") >= 0? "&" : "?" + "josso_error_type=" + e.getErrorType();
on_error += "&josso_username=" + g.getPrincipalName(ctx.getScheme(), c);

The problem is that when I have a parameterized URL with the character "?" the result of this operation is this one

http://server/login.action?act=loginError&&josso_username=user

And not for example,

http://server/login.action?act=loginError&josso_error_type=AUTH_FAILED&josso_username=user

I think that the ternary operation should be envolved in parenthesis like this

// Add error type and received username to ERROR URL.
on_error += (on_error.indexOf("?") >= 0? "&" : "?") + "josso_error_type=" + e.getErrorType();
on_error += "&josso_username=" + g.getPrincipalName(ctx.getScheme(), c);

Thanks, and sorry for the bad english.

Marcelo

Discussion

MongoDB Logo MongoDB