gpt4 book ai didi

python - Sendgrid 使用 API key 进行身份验证

转载 作者:行者123 更新时间:2023-12-03 15:41:51 34 4
gpt4 key购买 nike

我从 SentGrid 收到以下邮件,

We are emailing to inform you of an upcoming requirement to update your authentication method with Twilio SendGrid to API keys exclusively by December 9th, 2020 in order to ensure uninterrupted service and improve the security of your account. Our records show that you have used basic authentication with username and password for one or more of your API requests with 1 users of your SendGrid account in the last 180 days.


Why API keys?


This is an effort to enhance security for all of our users. Using your account username and password for authentication is less secure than using an API Key. Unlike your username and password, API Keys are uniquely generated and can be set to limit the access and specify permissions for a given request.


What action is required?


Follow these steps to identify and replace your authentication method to API Keys and then implement Two-Factor Authentication (2FA) for enhanced security.What happens if no action is taken?On December 9th, 2020 we will no longer accept basic authentication with username and password, and we will be requiring 2FA to login to your account. If you attempt to authenticate your API requests or SMTP configuration with username and password for any of your users after that date, your requests will be rejected.We’d like to thank you in advance for your prompt attention to these requirements. If you’d like to learn more about how you can enhance the security of your account, view this post. If you have any questions or need assistance, please visit our documentation or reach out to our Support team.Thank you,The Twilio SendGrid Team


目前我正在使用以下凭据向 sendgrid 发送邮件,
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_USE_TLS = False
EMAIL_PORT = 587
EMAIL_HOST_USER = 'xx@gmail.com'
EMAIL_HOST_PASSWORD = 'xxx'''

Is this change affect me?

最佳答案

是的,一旦他们强制执行两因素身份验证 (2FA),您的应用程序将无法仅使用用户名/电子邮件和密码进行基本身份验证。
因此,您需要开始使用 API key 。
迁移很简单:

  • 登录sendgrid账号
  • 转到 https://app.sendgrid.com/settings/api_keys
  • “生成 API key ”- 生成新的 API key 并复制粘贴以备后用
  • 代码更改:
  • EMAIL_HOST_USER = 'apikey'(用户名只能是这个)
  • EMAIL_HOST_PASSWORD = 'YOUR_API_KEY'

  • 测试一下

  • 如果更改有效,您就可以开始并从基本身份验证迁移到 API key 。

    关于python - Sendgrid 使用 API key 进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64464111/

    34 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com