aws cli 的响应不是 json 格式
aws cli's response is not json format
当我在 cognito 中使用 aws cognito-idp admin-initiate-auth
和 iterm 进行身份验证时,响应格式不是 json(如下所示)。
并且没有显示值的键,所以我找不到哪个是访问令牌。
你能告诉我如何将响应格式更改为 JSON 吗?
命令
aws cognito-idp admin-initiate-auth \
--user-pool-id poolId \
--client-id clientId \
--auth-flow ADMIN_NO_SRP_AUTH \
--auth-parameters USERNAME=test,PASSWORD=password \
--region us-east-2
回应
AUTHENTICATIONRESULT eyJraWQiOiJKYnJpK1VyWitNdkcwZUpjUnVpRXlQYkgxcGp6VEdxXC9SWHJkU2lUOVFmVT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjZjU5OWRiYi02OWI0LTRiYzUtYThjOC0yNTA0ZjYwZTk2NWMiLCJldmVudF9pZCI6ImM5MDliZjM3LWEzNTMtNDZlNS1hODc5LWJhMjU0YjEyNDhhMyIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiYXdzLmNvZ25pdG8uc2lnbmluLnVzZXIuYWRtaW4iLCJhdXRoX3RpbWUiOjE2MDYzOTQzMjEsImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWlkcC51cy1lYXN0LTIuYW1hem9uYXdzLmNvbVwvdXMtZWFzdC0yXzdBSThjQlJyUiIsImV4cCI6MTYwNjM5NzkyMSwiaWF0IjoxNjA2Mzk0MzIxLCJqdGkiOiIzNzZiOWM3OC1iYjBiLTQ5YWEtYjM4Yi0xMzU2ZGExODk4NmUiLCJjbGllbnRfaWQiOiI2NnY1NHNpMmw1ZXN1bmNmdXJvam5mOW1iaiIsInVzZXJuYW1lIjoidGVzdCJ9.hscAES9pBnzXABJvf2eI1UufKUIXvLBHr-_D9_isl73ytLbeDnSH0-gUl9LSPHgeQVZcNOxshsWzuEYMCB7HCVGUPtUtSMBma6Fd3n84RGOnYw768Wc9EvurY82liSFakeIT_9dCdTrhVzgXhlbH4dhmdxljYvCpn1LPS21AdN008KzLY9XAiXH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7VBVF87VZ2nGzxYIXgvXv5HbtGTOfJXV-0OJV7X3IOIni5Xv9_wK0kC_rfH6dKHu_qiJFGu_1VhMLEv4kfPGCvsHcTw10yLb0rQhn49lstSp432gBSc96iVCHTEUpIZvKZke8cpRPWkPwYdz3S5QN06u5Qm2-xutCdlS1R2nqwTJlMAd5vgrCAcuhQOil9sJzB3QygCZdkjzLjVn7WgyGg2O1RDjQLLHvHGWPWvfOAcxfrZ0edaB6hfIwq7q_-BhOKgvA.Ig_CXUVGKB1Y00szRUiI3Q Bearer
我不知道这是什么原因...我无法使用查询从响应中获取访问令牌。
aws cognito-idp admin-initiate-auth \
--user-pool-id poolId \
--client-id clientId \
--auth-flow ADMIN_NO_SRP_AUTH \
--auth-parameters USERNAME=test,PASSWORD=password \
--region us-east-2 \
--query "AuthorizationResult.AccessToken"
None
您可能在 config
文件或其他地方将 output
设置为 text
:https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-output.html
如果你想保持这种方式,你总是可以 运行 带有 --output json
作为附加参数的特定 cli 命令。
当我在 cognito 中使用 aws cognito-idp admin-initiate-auth
和 iterm 进行身份验证时,响应格式不是 json(如下所示)。
并且没有显示值的键,所以我找不到哪个是访问令牌。
你能告诉我如何将响应格式更改为 JSON 吗?
命令
aws cognito-idp admin-initiate-auth \
--user-pool-id poolId \
--client-id clientId \
--auth-flow ADMIN_NO_SRP_AUTH \
--auth-parameters USERNAME=test,PASSWORD=password \
--region us-east-2
回应
AUTHENTICATIONRESULT eyJraWQiOiJKYnJpK1VyWitNdkcwZUpjUnVpRXlQYkgxcGp6VEdxXC9SWHJkU2lUOVFmVT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjZjU5OWRiYi02OWI0LTRiYzUtYThjOC0yNTA0ZjYwZTk2NWMiLCJldmVudF9pZCI6ImM5MDliZjM3LWEzNTMtNDZlNS1hODc5LWJhMjU0YjEyNDhhMyIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiYXdzLmNv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O4_MqRY3KHYSTyUYg9WGSKyaZ9MXg1FWtORKJQK6CEtnUBgPXKRRwD9o8q5NI_E2xzp0m1Oo2K48iFEcY706DJrMd7nyzuMg0cQppnmIBan30QfRtRZD2Gz0LZOAfIrBmqUntCVB4BkxPD5U1qzOugKr6ZbyxlcfUtotCr5ZeBE5kKuHdobrPhSistrzpSnB1whldEEkK6f62ut91wV2pKqTVk7m1IHo7ZcKEcwWBXcjaalQ7U450bUO9Rpyv09wT2JTvLrtP3FDMLf57xQyVykQoDAXTGLx_0m5ZrtVaTJ6kETEKhgOwz2ulaI6olclu_J_bU0U5iC-9a1pga2x8aw-0NiDGRL738oaZIPwTDro0z4m66thIChWLib4u-BGguypKIE_8Txbes92pWDJTqf5aqzQCQqobUTb94mcGK3f3F8Gws8oIvW9Bz1SbCoZsfF0v4ijFryCS0GSHUqAl_6kP-QDUqZT1K1_BCZOoNRJHqqgGpc4uEgJUOmusns8cA8bCDa5_M4jNVhyP8XZDkOtbLdV7VBVF87VZ2nGzxYIXgvXv5HbtGTOfJXV-0OJV7X3IOIni5Xv9_wK0kC_rfH6dKHu_qiJFGu_1VhMLEv4kfPGCvsHcTw10yLb0rQhn49lstSp432gBSc96iVCHTEUpIZvKZke8cpRPWkPwYdz3S5QN06u5Qm2-xutCdlS1R2nqwTJlMAd5vgrCAcuhQOil9sJzB3QygCZdkjzLjVn7WgyGg2O1RDjQLLHvHGWPWvfOAcxfrZ0edaB6hfIwq7q_-BhOKgvA.Ig_CXUVGKB1Y00szRUiI3Q Bearer
我不知道这是什么原因...我无法使用查询从响应中获取访问令牌。
aws cognito-idp admin-initiate-auth \
--user-pool-id poolId \
--client-id clientId \
--auth-flow ADMIN_NO_SRP_AUTH \
--auth-parameters USERNAME=test,PASSWORD=password \
--region us-east-2 \
--query "AuthorizationResult.AccessToken"
None
您可能在 config
文件或其他地方将 output
设置为 text
:https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-output.html
如果你想保持这种方式,你总是可以 运行 带有 --output json
作为附加参数的特定 cli 命令。