Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Confluence-cloud Rest API returns 401 Unauthorize while fetching space with access token

Hi,

I have created an access token using the below-mentioned link

https://developer.atlassian.com/cloud/jira/platform/oauth-2-authorization-code-grants-3lo-for-apps/

When I use this access token along with confluence REST API to ge space data the error I receive is

{ "statusCode": 401,

"data": { "authorized": false, "valid": true, "errors": [], "successful": false },

"message":"com.atlassian.confluence.api.service.exceptions.AuthenticationRequiredException: Authentication is required"

}

below mentioned is request object

{

method: 'GET',
url: 'https://<domain>.atlassian.net/wiki/rest/api/space',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer <access_token>'

}

}

Can some one please help me with this.

1 answer

0 votes
Warren Community Leader Oct 25, 2019

Hi @kuldeep kushwaha 

In the authorization section, you need to be using both the token and the user e-mail address that the token was created with. That seems to be missing in what you've given above. You need to pass in a 64 bit encoded version of the e-mail / token pair.

Hi @Warren 

I am trying to make an API call using OAuth token and we encode email/API-token in basic authentication.


https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-basic-authentication/


As you said tried passing 64 bit encoded version of the e-mail / OAuth token in header got the following response.


Status: 403 Forbidden.
{ "error": "Failed to parse Connect Session Auth Token"}

Like Dmitry Lvov likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

Confluence Bingo Round 3!

That’s right! Grandma’s back at it again, and this time she’s brought all her friends. In honor of Team '21, this Bingo round is dedicated to all things team-related, and the prizes are no exception....

2,923 views 31 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you