grnq / joid

Java OpenID = JOID OpenID providers and relying parties for OpenID 1.1 and 2.0
Other
4 stars 0 forks source link

Improve error reporting for user hitting deny during login confirmation. #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Enter a valid OpenID user id
2. redirect to the OpenID provider site
3. Hit deny button when asked whether to let OpenID consumer know your identity

What is the expected output? What do you see instead?
A more information message than what is thrown
handle for server not found!

What version of the product are you using? On what operating system?
latest code from SVN

Please provide any additional information below.

suggested patch:
In JoidConsumer.authenticate, check right away what the mode is, if the
mode was cancel, throw an exception immediately to indicate actual error
reason.

        if(map.containsKey("openid.mode")) {
            String value = (String)map.get("openid.mode");
            if("cancel".equals(value)){
                throw new OpenIdException("client authentication process
was cancelled");
            }
        }

This would then be thrown prior to executing the code path that resulted in
the more generic message.

Original issue reported on code.google.com by kaplin...@alum.bentley.edu on 20 Oct 2007 at 6:10