Giter VIP home page Giter VIP logo

twitter's Introduction

Opauth

Opauth is a multi-provider authentication framework for PHP, inspired by OmniAuth for Ruby.

Opauth enables PHP applications to do user authentication with ease.

Try out Opauth for yourself at http://opauth.org

Build Status

What is Opauth?

Opauth provides a standardized method for PHP applications to interface with authentication providers.

Opauth as a framework provides a set of API that allows developers to create strategies that work in a predictable manner across PHP frameworks and applications.

Opauth works well with other PHP applications & frameworks. It is currently supported on:

If your PHP framework of choice is not yet listed, you can still use Opauth like you would a normal PHP component (class).

Quick start

Guide on how to run the bundled example.

  1. Set DocumentRoot of your web server to example/. (Opauth can be instantiated in your own PHP app, but we will leave that out of this quick start guide)

  2. Configure Opauth.

    First, make a copy of opauth config's file by copying or renaming opauth.conf.php.default to opauth.conf.php.

    Open up opauth.conf.php and make the necessary changes.

  3. Install some Opauth strategies. Place the strategy files in lib/Opauth/Strategy/.

    For this example, we recommend that you start with Opauth-Facebook:

    i. Download the strategy files and place them at lib/Opauth/Strategy/Facebook/.

    ii. Follow the steps at Opauth-Facebook's README to set up your Faceobok app.

    iii. Add the following at opauth.conf.php under Strategy as such:

<?php
'Strategy' => array(
    // Define strategies here.

    'Facebook' => array(
        'app_id' => 'YOUR APP ID',
        'app_secret' => 'YOUR APP SECRET'
    ),
);

Finally, send user to http://localhost/facebook to authenticate.

Check out the wiki for more in-depth details, especially on how to use Opauth with your own PHP application.

Available strategies

A strategy is a set of instructions that interfaces with respective authentication providers and relays it back to Opauth.

Provider-specific:

Strategy Maintained by
Bitbucket   Bitbucket fancyguy
Disqus   Disqus rasa
Do   Do arbales
Facebook   Facebook uzyn
Flickr   Flickr pocket7878
Foursquare   Foursquare pocket7878
GitHub   GitHub uzyn
Google   Google uzyn
Instagram   Instagram muhdazrain
LinkedIn   LinkedIn uzyn
Live Connect   (Windows) Live uzyn
mixi   mixi ritou
OpenID   OpenID uzyn
PayPal   PayPal 24hours
Sina Weibo   Sina Weibo (新浪微博) dgrabla
Twitter   Twitter uzyn
Vimeo   Vimeo LubosRemplik
VK   VKontakte dgrabla
   Yahoo! Japan (YConnect) ritou
   LINE Yuzuru Suzuki

Generic strategy: OAuth

See wiki's list of strategies for an updated list of Opauth strategies or to make requests. Refer also to strategy contribution guide if you would like to contribute a strategy.

Requirements

PHP 5 (>= 5.2) with allow_url_fopen enabled

Contribute

Opauth needs your contributions, especially the following:

  • More strategies Refer to wiki for contribution guide and inform us when your work is ready.

  • Plugins for more PHP frameworks and CMSes eg. Symfony, Laravel, WordPress, Drupal, etc.

  • Guides & tutorials On how to implement Opauth on CakePHP app, etc.

Issues & questions

Used Opauth in your project? Let us know!

Changelog

####v0.4.5 (25 Feb 2018)

  • Fixed a Security Incident for unsafe serialize/unserialize. (thanks @YuzuruS #124)

####v0.4.4 (10 May 2013)

  • Added HTTP User-Agent header. (thanks @rkaldung #41)

####v0.4.3 (10 January 2013)

  • Fixed a serverPost() bug where user-supplied options were not applied correctly. (thanks @ritou #26)

####v0.4.2 (28 August 2012)

  • Fix session to check for session_id() instead of $_SESSION (thanks @sirikkoster #20)

####v0.4.1 (22 July 2012)

  • Not starting session if session is already started. (thanks @Claymm)
  • Fixed incorrect error message. (thanks @Claymm)
  • Removed @ for file_get_contents. (thanks @Takehiro-Adachi)

####v0.4.0 (10 June 2012)

  • mapProfile() and clientGet() for OpauthStrategy class.

####v0.3.0 (30 May 2012)

  • Some unit testing
  • More consistent naming of Strategy's internal properties
  • Smarter loading of strategy, able to make a few guesses on where the class file might be at.

####v0.2.0 (23 May 2012)

  • Opauth is now Composer compatible and listed on Packagist
    • Opauth now supports autoloaders
    • If a strategy is not autoloaded, Opauth falls back and searches for it at strategy_dir defined in config.
  • Class name for strategy Foo should now be FooStrategy instead of Foo.
    • This is to reduce the likelihood of class name collision due to Opauth not requiring the use of namespace.
    • v0.1.0-type class name, ie. Foo, still works, but is now deprecated.

####v0.1.0 (22 May 2012)

  • Initial release

License

The MIT License Copyright © 2012-2013 U-Zyn Chua (http://uzyn.com)

Consultation

U-Zyn Chua is a Principal Consultant at Zynesis Consulting.

twitter's People

Contributors

angelxmoreno avatar bishop avatar ceeram avatar machour avatar nashjain avatar skennedy1492 avatar thejsa avatar uzyn avatar yuzurus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twitter's Issues

replace curl for gae

I'm trying to use the twitter strategy on Google App Engine, but it doesn't work due to lack of curl support.

As I see that other strategies (facebook and google for instance) do no use curl, I'm wondering how easy it would be to replace curl with PHPs native methods.

I've already tried purl (a curl replacement library for PHP at https://github.com/azayarni/purl) but although the author was so kind to add some of the missing functionality, it still does not work for me.

How to delete tweet

hi
im using your "tmhOAuth" image tweets sucessfully updated by using following code
" $img = './'.$img;
$code = $tmhOAuth->request('POST', 'https://api.twitter.com/1.1/statuses/update_with_media.json',
array( 'media[]' => "@{$img}", 'status' => "$txt" ), true, true) ; "

im getting tweet id also but i want how to delete tweet and which method used for delete tweet.
Thanks in advance

The Twitter REST API v1 is no longer active. Please migrate to API v1.1.

Authentication error: Opauth returns error auth response.
Array
(
[error] => Array
(
[provider] => Twitter
[code] => 410
[raw] => {"errors":[{"message":"The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.","code":64}]}
)

[timestamp] => 2015-11-30T01:27:02+00:00

)

Bad Authentication data

Hi! i followed the examples, but when change 'oauth_version' to 1.1 i have this error on callback:

Authentication error: Opauth returns error auth response.
Array
(
[error] => Array
(
[code] => 400
[raw] => {"errors":[{"message":"Bad Authentication data","code":215}]}
[provider] => Twitter
)

[timestamp] => 2013-08-27T04:09:51+00:00

)

auth with Facebook works, but I can not understand what I'm doing wrong with Twitter.

Thanks

Migrate to version1.1?

Hi I have a site developed in cakephp, I want to be able to login with twitter, I have follow example and the rightn way like Google and Facebook login that work.
When I implement and try to login with twitter I have this error return into my callback:
The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68

How can I solve this?

Thanks

401 Failed to validate oauth signature and token

For whatever reason I keep getting this error no matter what I do on callback.php.

Authentication error: Opauth returns error auth response.
Array
(
    [error] => Array
        (
            [code] => 401
            [raw] => Failed to validate oauth signature and token
            [provider] => Twitter
        )

    [timestamp] => 2013-01-13T03:27:58+00:00
)

However, if I refresh callback.php, I get the following result: http://cloud.chrisburton.me/M9M2

411 error when Content-Length='', works when ='0'

With the latest trunk version of opauth-twitter, I got this error:

Authentication error: Opauth returns error auth response.

Array
(
    [error] => Array
        (
            [code] => 411
            [raw] => 
            [provider] => Twitter
        )

    [timestamp] => 2012-10-27T04:29:19-07:00
)

when I changed line 625 of /vendor/opauth/opauth/lib/Opauth/Strategy/Twitter/Vendor/tmhOAuth/tmhOAuth.php from

  $this->headers['Content-Length'] = '';

to

  $this->headers['Content-Length'] = '0';

it worked.

Twitter e-mail validation

Before send request to twitter, I ask user for his e-mail. Can I add an extra parameter(like scope in google strategy) to send to twitter e-mail and validate it. I expect to receive in response something like this:
"email_verified" => 1(or 0)

Can I do this? Or how can I validate e-mail in other way?

Thanks.

Code 0 ?

anyone seen this before? I am using the CakePHP Opauth plugin and I get this:

array(
    'error' => array(
        'code' => (int) 0,
        'raw' => (int) 0,
        'provider' => 'Twitter'
    ),
    'timestamp' => '2014-09-08T06:02:01+00:00',
    'validated' => false
)

Callback error

When user go back from twitter we got URL like this
.../register/twitter/oauth_callback?denied=qKGB6VNZ2eANegKZgEoeh6Cit8ApCmrA2r2D9dI

TwitterStrategy.php: line 94

Update tmhOAuth to newest?

Just noticed there is an update to tmhOAuth. I'm having trouble getting the correct response back from Twitter, so it isn't really working for me. I tried to update tmhOAuth, but that didn't help either.

Can no longer authenticate due to Callback Enforcement

Since today Twitter has enabled Callback URL whitelisting, even though callback URL has been set in opauth and at twitter it has been whitelisted, it appears that this strategy is passing something else in the request, since it returns this error:

Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings

Undefined index: _opauth_twitter' When permission denied

I keep getting this exception thrown.

exception 'ErrorException' with message 'Undefined index: _opauth_twitter' in /TwitterStrategy.php:95

One of the urls is before
/opauth/twitter/oauth_callback?denied=Kgwq29X2b1eXPyH9QSMMDuMFgnDAXthYmtdAubT1EQo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.