- Setting Up The Application
- Register a new app at dev.twitter.com/apps
- While register the app please make sure check the Allow this application to be used to Sign in with Twitter item on.
- Memo the Consumer key and Consumer Secret. These strings will be used for twitter oauth.
- Include the twitteroauth library in your project.
- Set the config.php file with your Consumer Information.
- Go to http://yourhostname.com/twitter_login_path/login.php
- If everything worked correctly,you will be redirected to twitter.com
- Fill in your account information, click ログイン and then you will be redirected to http://yourhostname.com/twitter_login_path/callback.php
- The twitter user's account information will be print out. You can use the user's info to do something like saving to database or anything else.
- Go the [http://yourhostname.com/twitter_login_path/logout.php] to clear the session.