PHP commandline OAuth authorization for JIRA

I needed to get a user’s OAuth credentials from the commandline, for some commandline tools to work (Drush).

You will need OAuth installed from PECL for this, and have an OAuth link set up in JIRA (or whatever OAuth provider you are using).