Ask a Question

Bearer Auth Token - How to pass as header for each API resource

Occasional Contributor

Bearer Auth Token - How to pass as header for each API resource

Hello People,

I am new to Ready API and API automation in general.

For our API testing (JSON), initially we have to authorize with a bearer token in SWAGGER UI. Two API resources are present /auth/login & /auth/base64 and both these return an access token and user details respectively in encrypted format. The final bearer token format is: </auth/login: accesstoken>.</auth/base64 : message>

The bearer token has session time of 15 minutes after which we need to generate a new one.

Could anyone please let me know resources or steps on how to set the bearer token details for every Test Case in Ready API?



We have a few different options here.

You could use OAuth 1 or OAuth 2 profiles to retrieve those tokens in an automated fashion. You could also automatically refresh the token after a certain duration.
OAuth 1: 
OAuth 2: 
        OAuth 2 Advanced options: 

Or you could add a header parameter, and pass the token to an authentication header via get data. I think we should try the authentication profiles to start as we get more automation friendly advanced options. 

General auth page: 

SmartBear Alumni (Retired)

Thank you for the reply Matt!


Hi @Amytav, does this help?

Sonya Mihaljova
Community and Education Specialist

Showing results for 
Search instead for 
Did you mean: