简体   繁体   中英

oauth_problem=signature_invalid

I'm using pecl oauth in php, it workds fine in plain php using localhost, and I was able to get the request token. But when I use it on a framework, it throws exception and gives me oauth_problem=signature_invalid.

this framework is being used on a virtual host. Any idea?

(details can be found below as my comment)

Two of your three paste bins aren't working for me, but I'm also creating an OAuth provider myself and I ran into a problem with my keys. How are you storing them in the database?

In my case, I was saving the SHA1 keys into BINARY(20) columns by calling the MYSQL function UNHEX() when I inserted them and then calling HEX() when I pulled them out[1]. The problem was that HEX and UNHEX return uppercase values, and when I was generating the SHA1 keys using the sha1() function they were lowercase[2]. Make sure they are the same case, because it will affect the signature.

[1] Storing SHA1 hash values in MySQL
[2] http://us.php.net/sha1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM