Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

[Authentication] REST API call with different user credentials.

MichałS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2013

Hi everyone!

We have the following use care:

1. We log into jira with a standard user lets say "user A" (without admin permissions)

2. We use a custom plugin to copy an issue from "project A" to "project B" with the corresponding fix versions and components attached to this issue.

If "user A" has not admin permissions for "project B" we get an error message when creating components and fix versions (403 Forbidden).

Now the idea is that we would like to use different credentials for the REST calls creating componentes and fix versions (lets say "user B" who has admin permissions). So we change the Authorization header of the REST call to "user B" and get all elements created.

Unfortunately the issue with this solution is that the user loged into jira "user A" is changed to "user B" and that is what we want to omit because we would like to be still "user A".

Is it possible to call the REST API as a different user but still be able to continue after that as the old loged in user?

I have goggled a bit but without luck...

Thanks for help.

Michał

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2013

Nope, you will have to loggin as different users. You can't login as one user and then do operations as another using REST.

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2013

You can extend the remote API using a REST plugin and then expose a new functionality which does this.

MichałS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2013

Yapp... I was hoping it would be possible in some way...

Thanks for the good idea with custom REST plugin.

0 votes
Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2013

Does JIRA have the SOAP API like Confluence does? If so you could use the SOAP API and get an auth token with user B's creds and then perform the stuff with the SOAP API.

MichałS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 28, 2013

Yes but it is depricated in JIRA 6 and will be removed in JIRA 7, so it is not the way I will go :)

https://developer.atlassian.com/display/JIRADEV/SOAP+and+XML-RPC+API+Deprecated+in+JIRA+6.0

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 28, 2013

Ah, well that's a bummer.

TAGS
AUG Leaders

Atlassian Community Events