122
Views
7
Comments
Getting 403 error when passing Authorization (Bearer Token) in Header to the RestAPI
Question

Hello, 

I am getting a 403 Forbidden error when passing the Authorization (Bearer <access-token>) in the Header. Weird thing is, it works fine when I test the request from the Service Studio, but fails when running the application. Please assist in case of any solution. 


Works Fine:


Error Message From Service Center



2023-10-21 19-42-11
Tousif Khan
Champion

Hello

How you are passing the values for the api in your server action or where you are using this API

can you also debug this by adding a on before request action and add a Log message over there and check the logs on service center whether what is the request which is being sent 

add a dependency of log message action from systems module and add it to your on before request flow and see what is wrong,

as 403 error means you don't have a permission, so I suppose there is something in your request which is not being correctly pass,

try debug and see if everything is correct, also make sure you include bearer then space then the token.

I hope this will help

Best Rgeards
Tousif Khan

UserImage.jpg
Aditya Airen

Tried the above approach and still the same issue. 


2025-02-10 17-24-13
Arun Rajput

Hi @Aditya Airen 

As I can see in logs it's clearly mentioned you are something missing in Authorization.

You should debug the code and let check what is missing.

Best

Arun

UserImage.jpg
Aditya Airen

Please see the debug screenprint. Same issue. I re-checked the header params and all looks fine. I am passing the same when calling from service studio and it works but fails when running the app. 


UserImage.jpg
Brain Jaricha

I am also facing the same issue, did you got a solution for this?


Thanks in advance

2019-04-09 00-57-55
carl ruhle

Hi,

can you check your permissions,  not yours but the permissions of the Server, from what I could understand it looks like a permission asset.

Please keep us posted, thanks. 

UserImage.jpg
Brain Jaricha

Thanks Carl it's now working, I realised that the app wasn't approved by the admin.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.