Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Base64 encoding authentication and API call

John Nguyen
Contributor
February 24, 2018 edited

Hi all,

I encoded my <UserID>:<password> using command line:

echo -n <userID>:<password> | openssl base64

then I made an API call to retrieve my user profile:

"curl -D- -X GET -H "Authorization: Basic base64String" -H "Content-Type: application/json" "http://automationexpert.atlassian.net/rest/api/latest/myself"

And I got these status:

HTTP/1.1 301 Moved Permanently

Content-Type: text/html

Date: Sat, 24 Feb 2018 22:56:05 GMT

Location: <https: URL String>

Connection: Keep-Alive

Content-Length: 0

Question:

Where did the returned JSON go? :-).

What did I do wrong?

Thanks

J.N

1 answer

1 vote
John Nguyen
Contributor
February 24, 2018 edited

Anyone hint?  Thanks

John Nguyen
Contributor
February 24, 2018

Never mind.. I found that the API call did not return a JSON string but rather the URL (https) to the exposed API.

Good deal! :-)

Thanks anyway

J.N

Bunty
Contributor
October 22, 2018

Hi @John Nguyen,

could you provide me the steps on how to access Jira using Base64 encoded string?

 

Thanks in Advance,

Manikanta.

John Nguyen
Contributor
October 22, 2018

@Manikanta Reddy

  I also found a much more secure way to access your Jira's API using OAuth 1.0a.  I'll guide you through the steps once I got home.

  Do you know Java (or other high-level languages?).  You need to know at least one of them in order configure OAuth .

  In case you don't know any of high level languages, I still can walk you through... but it's harder for me (and you) to set it up.... but I'm willing to help.... stay tuned.

  John Nguyen

Bunty
Contributor
October 22, 2018

Hi @John Nguyen,

Thanks a lot for your quick response!

I don't know Java or any other languages. If you have any documentation could you please share so that I will try to set it up.  

Thanks Again,

Manikanta.

John Nguyen
Contributor
October 22, 2018

@Manikanta Reddy

 

There are a couple places you can use:

1 - OAuth implementation: 

     1.1 - Read this page entirely in order to understand what OAuth is :  

       https://developer.atlassian.com/server/jira/platform/oauth/

     1.2 - Implement the OAuth by going into section section : "Show me the codes!".

        It will direct you to the code base on GitHub.  You need to select the language that you want to implement the OAuth.  Work with someone who know the language well... this thing is quite complicated..

2 - There are other less secure but simple way to make REST API calls to Jira.  Read these instructions on this "Jira Developers" page:

https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/

In both cases, you might need someone with development background to walk you through....

  Keep this in mind: these instructions are meant for those who know some about sw dev.  You will find it hard to digest... so go get help.

  Good luck.

  John Nguyen

Bunty
Contributor
October 22, 2018

Thanks, @John Nguyen,

I will try and update you.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events