【发布时间】:2017-01-15 04:24:03
【问题描述】:
我正在尝试保护我为 Docusign Connect API 拥有的一个端点。我已经在 docusign connect API 配置中检查了 Sign Message with X509 Certificate。
客户证书公用名也会添加到 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 帐户中添加的通用名称与我在 YML 文件中提到的相同。有人可以帮我在这里找到问题吗?
我将 Ruby 2.2.2 与 rails 4.2.2、rails-auth 2.0.3 一起使用
【问题讨论】:
标签: ruby-on-rails-4 docusignapi ruby-2.2