grnq / joid

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

Failed to authenticate using myvidoop #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. try to sign in using myvidoop
2. validation of authentication sign fails since it includes sreg which is
an optional return value according to the spec but the current code ignores
it and only sets a hardcoded value (it is the same value returned by
myvidoop) if the request is openid v2.

To get around this issue, I made the following changes

1) AuthenticationResonse.toMap  added check to see if ns_reg was sent the
authentication response and if so use that.
    if(isVersion2()){
            if (ns_sreg != null){
                map.put(Message.OPENID_NS + ".sreg", ns_sreg);
            }
            else if (!set.isEmpty()) {
                map.put(Message.OPENID_NS + ".sreg",
SimpleRegistration.OPENID_SREG_NAMESPACE);
            }
    }

2) In public AuthenticationResponse(Map map) look for sreg and store that
in a local variable to be used in #1.

Original issue reported on code.google.com by tod...@us.ibm.com on 20 Aug 2008 at 6:56

GoogleCodeExporter commented 9 years ago

Original comment by birkan.d...@gmail.com on 21 Jul 2011 at 10:59