AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
325 stars 131 forks source link

Support for OAuth #101

Open replicaJunction opened 7 years ago

replicaJunction commented 7 years ago

OAuth has been one of those "eventually I'll get around to it" things, but it would be a significant help for large automation processes. It would also be useful for the integration testing - we could embed the OAuth token as a secure string in AppVeyor (similar to the PSGallery API key) and avoid any security concerns with username/password auth.

I'm not too familiar with OAuth, I'm afraid...anyone else feel like taking a stab at this?

Here are some relevant Atlassian resources: https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-oauth-authentication/

https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-oauth-authentication

lipkau commented 7 years ago

This Blog post describes how to use oAuth with WordPress: Using PowerShell and oAuth It must be used in combination with the Jira Developer tutorials, as the example above is for oAuth2

lipkau commented 7 years ago

oAuth authentication on Jira is an Application Link. We would need to provide instructions on how an admin must configure this

AllenBiehle commented 7 years ago

I was able to get a local REST endpoint setup for Jira (no success with confluence) using the node package oauth-rest-atlassian (https://www.npmjs.com/package/oauth-rest-atlassian), and then with that in place I'm able to hit the jira API without any auth (read only on localhost) via powershell's Invoke-WebRequest. The API structure is effectively the same as Jira's (since it's basically a local endpoint), but since the uri doesn't require username:password, it's different enough that JiraPS can't effectively utilize it. I've tried.

Here's what I'm trying to communicate... I don't think that it is trivial at all to completely stay within the confines of a pure powershell only implementation for oauth support. I've been looking for a long time for a magic solution for oauth, jira/confluence, and powershell but so far have only been able to achieve the Rube Goldberg implementation I have now. I have come across a few resources that might prove useful - but I don't know enough to pull it all together.

Resources that might be helpful:

If anyone has other resources that might be helpful for a potential contributor to this feature, I'd love to see them - at least to show that there's still interest.

brianbunke commented 7 years ago

Appreciate you sharing this. Like this issue, I consider OAuth to be "would be nice" status on the ConfluencePS project as well. But it'll probably take someone else cracking the nut, so posting how far you've made it is awesome.