Getting error while applying a Bearer Token in whole collections

Hi, I donā€™t get the proper response while using JWT token centrally(applying the same token to all collections).


Image of the response after configure Bearer token centrally
image

On the other hand if I config bearer token authorization collection-wise I am getting a response and itā€™s working perfectly.


Please help.

Hi @santunu23

There is no space between ā€œbearerā€ and your token ā€¦ this will likely be an issue;
image

Add a space after ā€œbearerā€, eg:
bearer eyJhbGC...

Can you show the headers for this;

image

My guess would be that the ā€œAuthorizationā€ header value doesnā€™t have the ā€œBearerā€ prefix.

Here is the header info. Thank you.

I stand corrected, it looks right.

Is your auth being set at collection or folder level?
If folder, is the API request you are sending inside that folder?

I tried to set it to folder level but canā€™t get a response. So I set up the collection level.

so do you have 2 auth levels set?
Have you removed the folder level auth?

For now, I removed folder level auth, temporary the setting is working fine with the collection level. Although my aim is to config folder level auth. But I donā€™t get the response.

Inherit from parent should work at folder level as long as the HTTP request is inside that folder. Are you sure that the request is a child of the folder where you set the auth?

Yeah, I am sure, right now I am running child under a folder. So I have no doubt about that. Hence, I am also reviewing my code. Maybe there is some misconfiguration.

Folder-level auth worked for meā€¦ So just a thought, when you edited the folder auth, did you click save?

Yes, I did save my folder-level auth setting.

Dear @w4dd325, the problem is solved. The problem was raised in the serverside script. In the script(not in the postman) I forgot to put an extra space after the ā€˜Bearerā€™ keyword. Thank you so much for your tremendous support.

1 Like