Hi all,
Sending GET request to /rest/api/2/project/{project-id} but keep getting 403 forbidden error with the following message
Basic Authentication Failure - Reason : AUTHENTICATION_DENIED
However the url in browser works and renders the response in proper JSON format.
Kindly Help.
Regards
This error indicates that the server has determined that you are not allowed access to the thing you've requested, either on purpose or due to a misconfiguration . It's probably because the site owner has limited access to it and you don't have permission to view it. The vast majority of the time, there's not much you can do to fix things on your (*client) end. There are three common causes for 403 Forbidden error (server side) . Here they are listed from most likely to least likely:
If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials. The client MAY repeat the request with new or different credentials. However, a request might be forbidden for reasons unrelated to the credentials.
Check the username/passsword used. Perhaps there was a typo.
Additionally, the user used for performing the REST call may not have the correct permissions to the project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Posting the api link in the browser is showing the result succesful in json format. So my user has permissions, but when i request the url from postman or python at the same endpoint , i will get denied as told in the message above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
External applications will need credentials to be provided unless the project is public access not needing any login. So, you need to set your credential into your app or script. Otherwise, the server will reply with a forbidden access.
Web clients keep your session alive through cookies so you do not need to repeatedly provide your credentials.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
so what's the use of the API Token you can create for your account?
I can access the GET /wiki/rest/api/content/{id} without any issues from Postman or from pasting the endpoint URL in the browser use the `Authentication: Basic <myToken>` header.
But making the same request from a react app hosted on localhost fails with HTTP 403.
Why?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Rob Fender Did you provide the token when performing the request in the app? Unfortunately, I am not familiar how react performs REST calls.
Also, your REST URL is 'wiki'; is this related to confluence, which could be posted in the confluence community as well to get wider reach and help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.