简体   繁体   中英

I'm getting {"__type":"ResourceNotFoundException","message":"User pool client clientId does not exist."} while obtaing access token in karate API

I'm getting {"__type":"ResourceNotFoundException","message":"User pool client clientId does not exist."} while obtaing access token in karate API framework and status code was 400

Script I used

Feature: Get Token

Background:
* header Content-Type = 'application/x-amz-json-1.1'
* header X-Amz-Target = 'AWSCognitoIdentityProviderService.InitiateAuth'


  Scenario: GEt access token
    Given url 'https://cognito-idp.us-east-1.amazonaws.com/'
    And request {"AuthParameters" : {"REFRESH_TOKEN" : refreshToken},"AuthFlow" : "REFRESH_TOKEN_AUTH","ClientId" : clientId } 
    When method post 
    Then status 200
    * print response

here I'm passing refresh token and client Id from karate-config.js file.

I'm getting {"__type":"ResourceNotFoundException","message":"User pool client clientId does not exist."} while obtaing access  token in karate API framework and status code was 400

Script I used 

Feature: Get Token

Background:

  • header Content-Type = 'application/x-amz-json-1.1'

  • header X-Amz-Target = 'AWSCognitoIdentityProviderService.InitiateAuth'

    Scenario: GEt access token Given url 'https://cognito-idp.us-east-1.amazonaws.com/' And request {"AuthParameters": {"REFRESH_TOKEN": refreshToken},"AuthFlow": "REFRESH_TOKEN_AUTH","ClientId": clientId } When method post Then status 200

    • print response


here I'm passing refresh token and client Id from karate-config.js file. 

The only thing I can think of is this change:

And request {"AuthParameters" : {"REFRESH_TOKEN" : '#(refreshToken)' },"AuthFlow" : "REFRESH_TOKEN_AUTH","ClientId" : '#(clientId)' } 

Refer the docs: https://github.com/karatelabs/karate#embedded-expressions

Otherwise no one can help you if your request data is wrong.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM