Forum Discussion

kreine's avatar
kreine
Occasional Visitor
8 years ago

Get Oauth2 token

Hello,

 

I am trying to use soapUI to create a load test for my restful micro-service.  The services use Oauth2 tokens for security.  When I add a new request to request and attempt to automate the token retrieval using the "Auth" tab at the bottom of the screen, I receive the error "Could not retrieve access token.  Check the SoapUI log for details.

 

I dutifully checked the SoapUI log and see these entries (see the actual screen capture in the attachment):

  • Attempt 1 to execute request
  • Sending request: POST /oauth/token HTTP/1.1
  • Receiving response: HTTP/1.1 401 Unauthorized
  • Connection can be kept alive indefinitely
  • Target requested authentication
  • Authorization challenge processed
  • Authentication scope: BASIC 'UAA/client'@sso.login.<rest of the domain>:8080
  • Credentials not found

Using Postman, I can send a POST http://sso.login.<rest of the domain>/oauth/token?grant_type=client_credentials with basic authorization using the same Client Id and Client Secret as I entered in SoapUI and get a token.

 

Any ideas on how I can configure SoapUI to return a token like Postman?  SoapUI is way more sophisticated than Postman and I would like to leverage that in the testing of my micro-services.

 

 

 

No RepliesBe the first to reply