我正在尝试保护我为 Docusign Connect API 拥有的一个端点。我已经在 docusign 连接 API 配置上检查了带有 X509 证书的签名消息。
客户证书公用名也会添加到 Docusign 帐户中。
我正在尝试验证使用 rails-auth gem 发送的主题。
以下是 ACL 文件(acl.yml)的内容
---
- resources:
- method: POST
path: /
allow_x509_subject:
cn: "the common name"
我在 config.ru 文件中添加了以下内容
app = Rails.application
acl = Rails::Auth::ACL.from_yaml(
File.read("path of the acl.yml"),
matchers: { allow_x509_subject: Rails::Auth::X509::Matcher }
)
acl_auth = Rails::Auth::ACL::Middleware.new(app, acl: acl)
x509_auth = Rails::Auth::X509::Middleware.new(
acl_auth,
ca_file: "path_to_the_pem_file.crt",
cert_filters: { 'X-SSL-Client-Cert' => :pem })
run x509_auth
我收到以下异常。
*** Rack 应用程序对象中的异常 Rails::Auth::NotAuthorizedError(未经授权的请求)
Docusign Account 中添加的 Common Name 与我在 YML 文件中提到的相同。有人可以帮我在这里找到问题吗?
我正在使用带有 rails 4.2.2、rails-auth 2.0.3 的 Ruby 2.2.2