Amazon SNS:如何获取令牌以确认订阅 [英] Amazon SNS: how to get token for confirm subscription

查看:249
本文介绍了Amazon SNS:如何获取令牌以确认订阅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下操作将创建一个等待确认的订阅.

Following creates a subscription waiting to be confirmed.

aws_client.subscribe(TopicArn=topic_arn, Protocol=protocol, Endpoint=endpoint)

对此的响应类似于:

{'ResponseMetadata': {'HTTPHeaders': {'content-length': '298',
   'content-type': 'text/xml',
   'date': 'Fri, 13 Oct 2017 10:15:47 GMT',
   'x-amzn-requestid': '7a0a40fb-ab72-5584-94f0-12a13fe11das'},
  'HTTPStatusCode': 200,
  'RequestId': '7a0a40fb-ab72-5584-94f0-12a13fe11das',
  'RetryAttempts': 0},
 u'SubscriptionArn': 'pending confirmation'}

以上响应未发送任何令牌. 如何获得可以如所述

above response did not send any token. How to get the token which can be passed to confirm_subscription as stated here

推荐答案

似乎,在subscribe命令本身的响应内部,令牌不可用.相反,正如Boto 3文档中提到的 ,令牌是

It seems, the Token is not available from inside the response of the subscribe command itself. Rather, as mentioned in the Boto 3 documentation, the token is

"... 通过先前的订阅"操作发送到端点 ." ( 重点 是我的)

"...sent to the endpoint by an earlier Subscribe action." (emphasis mine)

AWS CLI命令参考指出同样的事情,但也许更清楚一点:

The AWS CLI Command Reference states the same thing, but a little bit more clearly perhaps:

在订阅操作期间,短期令牌 已发送到端点 ." ( 重点 是我的)

"Short-lived token sent to an endpoint during the subscribe action." (emphasis mine)

换句话说,对于电子邮件端点,令牌位于电子邮件本身中.如果您查看确认订阅"链接的URL,就可以看到它.

In other words, for an Email Endpoint, the Token is in the email itself. You can see it if you look at the URL for the "Confirm subscription" Link.

例如,其外观类似于在此示例中,您可以看到令牌为 abc123 .

Here in this example, you can see the Token would be abc123.

这篇关于Amazon SNS:如何获取令牌以确认订阅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆