iignatov / LightOpenID

Lightweight PHP5 library for easy OpenID authentication.
MIT License
79 stars 96 forks source link

$openid->validate() returns false #2

Closed wturnerharris closed 11 years ago

wturnerharris commented 11 years ago

Everything in data array appears to be valid results, yet the validate method returns false. I think this has to do with the results being urlencoded somehow. Previously, I can't remember which lightopenid class I was using; it had urls that was not encoded, and consequently the validate method returned true with the entire claimed_id as the $openid->identity.

That is, http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0 used to look like http://specs.openid.net/auth/2.0

Any ideas as to why this occurs? The reason I switched to your fork was to support the xrdsOverride method and the getOAuthRequestToken methods. I'm now seeing openid_ext1_request_token as part of data, but the validate still returns false.

Again, any help you can provide would be appreciated.

wturnerharris commented 11 years ago

I should note that if I add the following after line 59 in openid.php, it works out of the box.

        [59] $this->data = ($_SERVER['REQUEST_METHOD'] === 'POST') ? $_POST : $_GET;
        [60] foreach( $this->data as $key=>$val){
        [61]    $this->data[$key] = urldecode($val);
        [62] }

I think there's some matching that's going on that doesn't match when the url is encoded. I don't know what was doing the encoding before in the other lightopenid class I was using.

wturnerharris commented 11 years ago

Nevermind. Duh! Was an issue with htaccess rewriting the url.