twitokengen command provides super simple way to get access_token and access_token_secret using OAuth login with Twitter.
$ twitokengen YOURCONSUMERKEY YOURCONSUMERSECRETThen web browser opens the url for authorization, login with Twitter, redirected to twitokengen, and tokens will be shown.