I'd love to see OAuth authentication support added to this rather than needing to use a username and password. Any way you can at least modularize the authentication into some sort of plugin system?

Comments

jlnd’s picture

I would love to see this as well! I tried to implement it myself, but Atlassian's JIRA OAuth documentation sucks and I hit a dead end. I was able to get their PHP OAuth example working on a web server, but the example came with a whole bunch of dependencies. I couldn't figure out how to strip out the OAuth logic from the framework in order to integrate it into Drupal.

I piled on a thread opened by someone else asking Atlassian to provide an example without so many dependencies. https://bitbucket.org/atlassian_tutorial/atlassian-oauth-examples/issue/...

therobyouknow’s picture

I have chipped in on that Atlassian issue in support of you. I haven't (yet) been through the same pain as you as I haven't attempted to get OAuth working. But, are you aware of: https://www.drupal.org/project/jiraconnect ? I haven't tried this module yet but wondered if you had used it? I have asked the author that module if they are considering a Drupal 8 version, before I commit any effort implementing my own solution. I am also following this issue here.

jlnd’s picture

@therobyouknow - I haven't tried that module. It isn't exactly what I was looking for at the time. I wasn't trying to give JIRA users a way to authenticate to the site. I wanted to have a public page that JIRA users could put their credentials into that would allow them to fill out a form to push tickets to JIRA. ...But maybe I should rethink that. If they were to authenticate and log in to the site, then submit a private form that would pass along the user information, that might work. Maybe I'll try that at some point.

therobyouknow’s picture

Apart from Atlassian's own example, the most complete and comprehensive guide to OAuth 1.0a, with PHP examples I could find, is in the book: Programming Social Applications - http://shop.oreilly.com/product/0636920014201.do - there is an entire chapter devoted to OAuth, with a detailed section on OAuth 1.0a with PHP examples and walkthrough of the code. However the dependent library - PHP OAuth that was hosted on Google Code has disappeared and I don't know where it might now be hosted.

http://oauth.net/code/ is worth a look, in particular, this PHP class, looks promising:
"Manuel Lemos has written a php OAuth class that abstracts OAuth 1.0a and OAuth 2.0 in the same class. It provides built-in support to several popular OAuth servers, so you do not have to spend time configuring the respective end point URLs. It supports every other OAuth server through specific configuration variables, including some meant to workaround OAuth implementation glitches that some servers have. Documentation and practical examples come with the class package."
http://www.phpclasses.org/package/7700-PHP-Authorize-and-access-APIs-usi...
though I haven't tried it yet.

Also:
http://stackoverflow.com/questions/7308662/simple-php-and-oauth-library
https://code.google.com/archive/p/oauth-php/

My strategy that I myself will take will be to write a bare bones PHP web app with one of the above and once working, build it into a Drupal module.