[英]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我得到 {"__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.在这里,我从 karate-config.js 文件传递刷新令牌和客户端 ID。
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 Content-Type = 'application/x-amz-json-1.1'
header X-Amz-Target = 'AWSCognitoIdentityProviderService.InitiateAuth' 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场景:GEt 访问令牌给定 url 'https://cognito-idp.us-east-1.amazonaws.com/' 并请求 {"AuthParameters": {"REFRESH_TOKEN": refreshToken},"AuthFlow": "REFRESH_TOKEN_AUTH", "ClientId": clientId } When method post Then status 200
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参考文档: https://github.com/karatelabs/karate#embedded-expressions
Otherwise no one can help you if your request data is wrong.否则,如果您的请求数据有误,没有人可以帮助您。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.