andygrunwald/go-jira

Oauth

AlbinOS opened this issue · 10 comments

I'm trying to implement Oauth authentification with our jira cloud platform and I see on the README.md that this library support it but I have trouble to wrap my head around this feature.

Does anybody have a working example ?

Thanks a lot !

Lupus commented

I've chopped some of my code I've came up with recently and uploaded it as a gist [1]. I have not proof-compiled it, but it ought to work. Just call getJIRAClient() to get a fully configured client object. Also give a look at [2], it is a nice tutorial for getting JIRA administration part done.

[1] https://gist.github.com/Lupus/edafe9a7c5c6b13407293d795442fe67
[2] https://www.prodpad.com/2013/05/tech-tutorial-oauth-in-jira/

@Lupus, awesome ! Thanks a lot !

I'll look at it.

Sounds like a plan!
Thank you @Lupus for the answer and @AlbinOS for the question!

Lupus commented

@andygrunwald may be it makes sense to include this in your repo as a part of API or as an example? It took me quite a while to figure this out, and other folks are also struggling with this.

I could make a PR for this if you think it will be useful.

@Lupus Yeah, why not. Good catch.
I would prefer as an example + a small note in the readme with a link to this example.

Would be good if you can create a PR.

Lupus commented

Awesome, sounds good to me. Will do the PR once I have some spare time.

Thank you. Until this i will leave this issue open.

@Lupus @AlbinOS I added a link to the gist and to this issue into the readme. Checkout https://github.com/andygrunwald/go-jira#authenticate-with-oauth

I hope this works for you :)

Lupus commented

Wow, thanks! Sorry for not looking into this for so long... My jira tool got deprioritized in my todo list along with related items :(

thanks @Lupus for the gist, it helped me a lot!