michelangelo13 / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

UserSetupUrl NullPointerException in checkid_immediate #103

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a ServerManager, don't set the UserSetupUrl (or
manager.setUserSetupUrl(null) )
2. Execute a checkid_immediate request that will cause an negative response

What is the expected output? What do you see instead?
In the protocol version 2.0 userSetupUrl should not be an issue.

What version of the product are you using? On what operating system?
0.9.5

Please provide any additional information below.
public static void main(String[] args) throws Exception 
    {
        BasicHttpRequest request = new BasicHttpRequest("GET",
"/openid?openid.mode=checkid_immediate&" +
                "openid.ns=http://specs.openid.net/auth/2.0&" +
                "openid.claimed_id=http://www.test.com.br/openid/user&" +
                "openid.identity=http://www.test.com.br/openid/user&" +
                "openid.return_to=http://mysite.test.com/openid");

        ServerManager openidManager = new ServerManager();
        openidManager.setOPEndpointUrl("http://www.test.com.br/openid");
        URI uri = new URI(request.getRequestLine().getUri());
        String encodedParams = uri.getRawQuery();

        String decoded = URLDecoder.decode(encodedParams, "UTF-8");
        //parse query string in a map
        Map<String, String> query = getQueryMap(decoded);
        ParameterList requestParams = new ParameterList(query);
        Message openidResp = openidManager.authResponse(requestParams, null,
null, false, true);
    }

will generate:
Exception in thread "main" java.lang.NullPointerException
    at org.openid4java.server.ServerManager.authResponse(ServerManager.java:773)
    at org.openid4java.server.ServerManager.authResponse(ServerManager.java:605)
    at org.openid4java.server.ServerManager.authResponse(ServerManager.java:511)

Original issue reported on code.google.com by caiobran...@gmail.com on 23 Dec 2009 at 9:19

GoogleCodeExporter commented 9 years ago
Fixed in r682.

Original comment by Johnny.B...@gmail.com on 31 Oct 2012 at 7:21