如何通过CLI
问题描述:
设置在亚马逊cognito Twitter的应用程序消费凭证从CLI如何通过CLI
aws cognito-identity update-identity-pool \
--identity-pool-id MyIdentityPoolId \
--identity-pool-name MyIdentityPoolName \
--allow-unauthenticated-identities \
--supported-login-providers graph.facebook.com=MyFacebookAppId,api.twitter.com=MyTwitterConsumerKey;MyTwitterConsumerSecret \
--region $MyRegion
的CLI响应尝试这种说:
{
"SupportedLoginProviders": {
"api.twitter.com": "MyTwitterConsumerKey",
"graph.facebook.com": "MyFacebookAppId"
},
"AllowUnauthenticatedIdentities": true,
"IdentityPoolName": "MyIdentityPoolName",
"IdentityPoolId": "MyIdentityPoolId"
}
MyTwitterConsumerSecret: command not found
不同配置的Facebook(仅需要一个凭证( FacebookAppId),配置twitter需要2个凭据(ConsumerKey和ConsumerSecret)。
如果我用分号分隔2个证书,看起来像只有第一部分在twitter配置中设置为amazon cognito。 附加屏幕截图。
什么是同时通过ConsumerKey和ConsumerSecret配置Twitter的格式?
我提到了这些AWS文档:
答
确定。多么愚蠢。只需将范围在--supported-login-providers
的凭证放在双引号内。
--supported-login-providers graph.facebook.com="MyFacebookAppId",api.twitter.com="MyTwitterConsumerKey;MyTwitterConsumerSecret"
然后它工作。
{
"SupportedLoginProviders": {
"api.twitter.com": "MyTwitterConsumerKey;MyTwitterConsumerSecret",
"graph.facebook.com": "MyFacebookAppId"
},
"AllowUnauthenticatedIdentities": true,
"IdentityPoolName": "MyIdentityPoolName",
"IdentityPoolId": "MyIdentityPoolId"
}
';'是一个shell元字符,需要转义为文字。把它放在双引号或单引号中也可以直接处理它。 – andlrc