1

I tried to automate using karate framework following steps which I did in postman. How I tried in Postman:

  1. On Authorization tab select OAuth 2.0
  2. Select Header Prefix Bearer
  3. Grant-Type is "Implicit"
  4. I put Callback URL
  5. I put Auth URL
  6. I put Client ID
  7. Select "Client Authentication" as Send as Basic Auth Header.

I used following code in order to get Access token Background:

 * url 'Auth URL'

  Scenario: Verify the user details using OAuth2 Implicit grant type

    * form field callbackurl = 'callbackurl'
    * form field grant_type = 'implicit'
    * form field client_id = 'client id'
    * form field username = 'username'
    * form field password = 'password'
    * method post
    * status 200
    * print response

    * def accessToken = response.access_token

    * path 'resource'
    * header Authorization = 'Bearer ' + accessToken
# * param access_token = accessToken
    * method post
    * status 200

In output I got // UserpoolId is not available on frontend for springboard. We do not use userPoolId // anyway other than put in context data. var userPoolId = ""; var clientId = getUrlParameter("client_id");

I do not know where I am wrong. Please provide your help. Thanks!

  • please refer to this answer: https://stackoverflow.com/a/69075964/143475 - and I can help if you can provide a working example that I can access on the public internet. else, please take the help of someone who knows the server-side in your case and also post an answer here if you solve it – Peter Thomas May 02 '22 at 13:35
  • 1
    @PeterThomas one off topic question, can you please send me example how to use karate with GraphQL when we have Query like: mutation($data: ParameterInput!){ updateParameter(parameterInput: $data) } and Graph Variables like { "data":{ "id": 135, "name": "TimeoutSeconds", "value": 100, "routingKeyIds": [51] } } Thank you! – risto ristanoski May 02 '22 at 20:31
  • read this please: https://stackoverflow.com/a/69360978/143475 – Peter Thomas May 03 '22 at 02:44

0 Answers0