开发者

Authenticate OAuth from Script

开发者 https://www.devze.com 2023-01-11 09:10 出处:网络
Can anyone tell me how I could go about authenticating with the various OAuth login mechanisms on the internets (Twitter, Facebook) so that I can run scripts against these services.

Can anyone tell me how I could go about authenticating with the various OAuth login mechanisms on the internets (Twitter, Facebook) so that I can run scripts against these services.

As an example, right now when I use Facebook data I goto graph.facebook.com and copy paste the access key from the URL. Obviously this is a bad approach, it has sufficed for now, but is not really an option anymore :)

I've checked out the documentation on the facebook site in particular which requests that I use a callback urL an开发者_高级运维d so on. I'd like to be able to make a call from a ruby script which requests the OAuth token instead.

Is this even possible?

P.s This would be using my own credentials.


Yes, it is possible. http://developers.facebook.com/docs/authentication/ "Authenticating as an Application" section.


You can get the Access Token using a web redirection, and then store it to perform further offline operations. Some APIs need explicit user scope permission to do that.

0

精彩评论

暂无评论...
验证码 换一张
取 消