简体   繁体   中英

Jira Oauth: 401 Unauthorized in PHP oauth_problem=“signature_invalid”

I am developing some tools for login in Jira by using Oauth. I am using sample tutorial ie https://bitbucket.org/atlassian_tutorial/atlassian-oauth-examples/src/d625161454d1ca97b4515c6147b093fac9a68f7e/php/?at=default

In response it shows

[response] HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
WWW-Authenticate: OAuth realm="http%3A%2F%2F10.36.4.32", OAuth realm="http%3A%2F%2F10.36.4.32", oauth_signature="L0%2Be6nyQw%2BUcqJLffITO5%2F7WyXt20vQYj5kMTrKpzjzLJL96Jzn1TJjriVRArxUuK%2FEUCwWzxnCuD2cLhc5cWUT1l4KK%2BDx2vNeTGi58otw8g6ehS0bHt2ny58%2Fze7yWNatYRhgQtbbzME7tWZWXlA%2F5LLVBzXuVIHaxQS0asw0%3D", oauth_signature_base_string="POST%26http%253A%252F%252F10.36.4.32%252Fplugins%252Fservlet%252Foauth%252Frequest-token%26oauth_callback%253Dhttp%25253A%25252F%25252Fabu-dev-mix03.ubisoft.org%25252F~ali.ejaz%25252FTaskManagement%25252Foauth%25252Fphp%25252Fweb%25252Findex.php%25252Fcallback%2526oauth_consumer_key%253Dubisoft.org%2526oauth_nonce%253Dc3ddcd31e18c4f53f5ae3ac2079ad1d51bd0cf68%2526oauth_signature_method%253DRSA-SHA1%2526oauth_timestamp%253D1432712645%2526oauth_version%253D1.0", oauth_problem="signature_invalid", oauth_signature_method="RSA-SHA1"
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
Content-Length: 758
Date: Wed, 27 May 2015 07:44:05 GMT

oauth_signature=L0%2Be6nyQw%2BUcqJLffITO5%2F7WyXt20vQYj5kMTrKpzjzLJL96Jzn1TJjriVRArxUuK%2FEUCwWzxnCuD2cLhc5cWUT1l4KK%2BDx2vNeTGi58otw8g6ehS0bHt2ny58%2Fze7yWNatYRhgQtbbzME7tWZWXlA%2F5LLVBzXuVIHaxQS0asw0%3D&oauth_signature_base_string=POST%26http%253A%252F%252F10.36.4.32%252Fplugins%252Fservlet%252Foauth%252Frequest-token%26oauth_callback%253Dhttp%25253A%25252F%25252Fabu-dev-mix03.ubisoft.org%25252F~ali.ejaz%25252FTaskManagement%25252Foauth%25252Fphp%25252Fweb%25252Findex.php%25252Fcallback%2526oauth_consumer_key%253Dubisoft.org%2526oauth_nonce%253Dc3ddcd31e18c4f53f5ae3ac2079ad1d51bd0cf68%2526oauth_signature_method%253DRSA-SHA1%2526oauth_timestamp%253D1432712645%2526oauth_version%253D1.0&oauth_problem=signature_invalid&oauth_signature_method=RSA-SHA1

I have jira instance in my local machine but Oauth code is on local server.

I am providing different Public key in Jira and in Application. After correction this issue it runs great.

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