简体   繁体   English

oauth_problem=signature_invalid

[英]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.我在 php 中使用 pecl oauth,它在普通的 php 中使用本地主机运行良好,并且我能够获得请求令牌。 But when I use it on a framework, it throws exception and gives me oauth_problem=signature_invalid.但是当我在框架上使用它时,它会抛出异常并给我 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.你的三个粘贴箱中有两个不适合我,但我自己也在创建一个 OAuth 提供程序,我的密钥遇到了问题。 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].在我的例子中,我通过调用 MYSQL function UNHEX()将 SHA1 键保存到BINARY(20)列中,然后在我拔出它们时调用HEX() [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].问题是 HEX 和 UNHEX 返回大写值,当我使用sha1() function 生成 SHA1 密钥时,它们是小写的[2]。 Make sure they are the same case, because it will affect the signature.确保它们是相同的大小写,因为它会影响签名。

[1] Storing SHA1 hash values in MySQL [1] 在 MySQL 中存储 SHA1 hash 值
[2] http://us.php.net/sha1 [2] http://us.php.net/sha1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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