Forum Discussion

m_norlin's avatar
m_norlin
Visitor
2 years ago

Headers missing when requesting oauth access token - how do I set them?

I've been tasked with making some REST API tests with SoapUI for a system. The system is using oauth2. So to be able to do requests, I need to fetch an access token first. So I've added oauth2 authorization (under "auth" tab) and configured the authentication dialog under "get token" and used the same settings as we already have in Postman, where retrieving tokens works fine. But when I try to fetch one in SoapUI, it fails with a 401 Unauthorized.

 

If I fetch a token using Postman and paste it into the "access token" field in SoapUI, everything works fine: I can access our system and do tests.
So it's just the "get token"-part that is problematic.

 

Studying the logs and comparing Postman and SoapUI requests, I found that some headers included by Postman are omitted by SoapUI.
Critical seems to be at least the header called "authorization", set to "Basic [base64 encoded clientId:clientSecret]"


How do I make SoapUI include this header (and possibly others) when fetching the access token?
Adding it as a normal header under the "headers" tab for the main request didn't help.

 

Thankful for advice,
Martin

No RepliesBe the first to reply