Steps
1. Go to URL - http://twitter.com/apps and fill username and password. Create account if you don't have one.
2. You will see Create Application page. Press Create Application and you will then see this page.
3. Fill your application name, app description and callback url. Write a valid url as callback url. This url is important, use addcallback method to provide the url in the code.You will then see this page.
4. The details page contains info about consumer key and secret.Go to Settings page and give your app read-write access as shown below :