简体   繁体   English

如何在不使用oauth-php库的情况下使用OAuth和PHP?

[英]How can I use OAuth and PHP without using the oauth-php library?

I need to build a script that uses OAuth authentication to connect to Foursquare's API, but oauth-php library is too complicated. 我需要构建一个使用OAuth身份验证连接到Foursquare的API的脚本,但是oauth-php库太复杂了。

Any one page scripts that don't use MySQL? 任何一个不使用MySQL的页面脚本? I would rather just use cookies. 我宁愿只使用cookies。

This library is really simple to use: 这个库非常简单易用:

http://github.com/jrconlin/oauthsimple/ http://github.com/jrconlin/oauthsimple/

Check out the oauth portion of the library at http://code.google.com/p/photobucket-api-php5/ 请访问http://code.google.com/p/photobucket-api-php5/查看该库的oauth部分

Also, the Zend_Oauth module (available in the incubator, and hopefully in the next Framework release) is excellent and easy to use. 此外, Zend_Oauth模块(在孵化器中可用,希望在下一个Framework版本中)非常好且易于使用。 It just looks like a Zend_Http_Client after you set it up. 设置后它看起来就像Zend_Http_Client

我已经使用过这个库: http//code.google.com/p/oauth-php/现在能够理解为什么消费者和服务器基本上有两种不同的东西它看来这里的例子就是在这里做同样的事情。

If you dont want to use oauth-php library you can even write your own small lib doing this. 如果您不想使用oauth-php库,您甚至可以编写自己的小型lib。 You can for example check my the simplest and the smallest implementation of the OAuth with Twitter and Linked: 例如,您可以使用Twitter和Linked检查我最简单和最小的OAuth实现:

https://github.com/adrianmalik/php-oauth/blob/master/README.md https://github.com/adrianmalik/php-oauth/blob/master/README.md

There will find everything you need to do this. 你会发现你需要做的一切。

Have you tried this one? 你试过这个吗?

https://svn.iamcal.com/public/php/lib_oauth/lib_oauth.php https://svn.iamcal.com/public/php/lib_oauth/lib_oauth.php

It wouldn't fit in one page but it's really simple. 它不适合一页,但它非常简单。

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

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