How to get an OAuth Request Token for Google using java

后端 未结 2 701
遇见更好的自我
遇见更好的自我 2021-01-03 13:19

I\'m struggling to fetch a request token from google when trying to access the APIs. I\'m receiving the standard 400 response. The request i\'m sending is almost identical t

相关标签:
2条回答
  • 2021-01-03 13:48

    It should be m.init(new SecretKeySpec("anonymous&".getBytes(), "HmacSHA1")); When the oauth_token_secret is empty, you still need the "&" joining the two secrets to make the complete signature key.

    0 讨论(0)
  • 2021-01-03 14:01

    I would suggest using an OAuth library for this, in order to have a higher level of abstraction.

    Checkout the following blog post for an OAuth interaction using Signpost and j2se :

    http://blog.doityourselfandroid.com/2010/11/08/oauth-in-java-the-signpost-library/

    The blog also contains some other info regarding OAuth.

    Another important thing worth mentioning is to make sure your date/time settings are setup correctly on the client. When you interact with the service provider, and you end up sending wrong timestamps, your requests will get refused.

    0 讨论(0)
提交回复
热议问题