Twitter strategy for Opauth
Clone or download
Latest commit 5939081 Jun 18, 2018
Failed to load latest commit information.
Vendor/tmhOAuth Upgraded tmhOAuth to v0.7.1. Fixes #9 Oct 28, 2012
.gitignore opauth-twitter initialized from main opauth framework May 15, 2012 Fix Twitter doc url Jun 13, 2018
TwitterStrategy.php Merge pull request #30 from nashjain/patch-2 Jun 15, 2017


Twitter strategy for Opauth, based on Opauth-OAuth.

Getting started

  1. Install Opauth-Twitter:

    cd path_to_opauth/Strategy
    git clone Twitter


    composer require opauth/twitter
  2. Create Twitter application at

    • Make sure to enter a Callback URL or callback will be disallowed.
      Callback URL can be a made up one as Opauth will explicitly provide the correct one as part of the OAuth process.
    • Register your domains at @Anywhere domains.
      Twitter only allows authentication from authorized domains.
  3. Configure Opauth-Twitter strategy with at least Consumer key and Consumer secret.

  4. Direct user to http://path_to_opauth/twitter to authenticate

Strategy configuration

Required parameters:

'Twitter' => array(
	'key' => 'YOUR CONSUMER KEY',

See Twitter.php for optional parameters.

Opauth-Twitter does "Sign In with Twitter" by default.
If you prefer to do a 3-legged OAuth, explicitly add authenticate_url parameter to strategy configuration and set it to


tmhOAuth requires hash_hmac and cURL.
hash_hmac is available on PHP 5 >= 5.1.2.



Opauth-Twitter is MIT Licensed
Copyright © 2012 U-Zyn Chua (

tmhOAuth is Apache 2 licensed.