【问题标题】:Having "@" in username in credentials URL Basic authentication在凭据 URL 基本身份验证中的用户名中包含“@”
【发布时间】:2021-12-06 01:53:46
【问题描述】:

我正在尝试使用 Stripe webhook 调用 API 以将事件推送到该 API。据我了解,stripe 有一种方法可以通过使用 https://{username}:{password}@myAPI.com 为 webhook 添加基本身份验证,然后将 base64 编码用户名和密码作为基本 {based64encodedToken} 到端点 @987654321 @

但是,基本认证的用户名中包含“@”,例如:user1@myapp-1awjn。然后会弄乱API。有人知道如何逃脱吗?

【问题讨论】:

  • 为什么不用AT_SIGN来表示'@'
  • 你能举个例子吗?

标签: api encoding base64 stripe-payments urlencode


【解决方案1】:

根据spec,您所描述的不是authority URI 部分中userinfo 的有效形式。

用户信息(如果存在)后跟广告 at-sign ("@") 将其与主机分隔开来。

如果你需要这个,你需要对@进行URL编码并在你的系统中解析,例如https://user%40cool@example.com/

【讨论】:

  • 欣赏!!
猜你喜欢
  • 2012-12-20
  • 2018-11-10
  • 1970-01-01
  • 2011-10-06
  • 2016-04-07
  • 2011-02-12
  • 2021-07-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多