我有门卫在当地工作,但一旦部署到生产我有一个奇怪的问题.我无法创建新的应用程序,请参阅下文: $ app = Doorkeeper::Application.new :name = 'test', :redirect_uri = 'http://test.com'= #Doorkeeper::Applica
$> app = Doorkeeper::Application.new :name => 'test', :redirect_uri => 'http://test.com' => #<Doorkeeper::Application id: nil, name: "test", uid: nil, secret: nil, redirect_uri: "http://test.com", scopes: "", created_at: nil, updated_at: nil> $> app.save (0.8ms) BEGIN (0.8ms) BEGIN Doorkeeper::Application Exists (0.7ms) SELECT 1 AS one FROM `oauth_applications` WHERE `oauth_applications`.`uid` = BINARY '56bf468e5a1d116e3daef75ecc49b6b6ba313a9a79815b5b4683d56851880c49' LIMIT 1 Doorkeeper::Application Exists (0.7ms) SELECT 1 AS one FROM `oauth_applications` WHERE `oauth_applications`.`uid` = BINARY '56bf468e5a1d116e3daef75ecc49b6b6ba313a9a79815b5b4683d56851880c49' LIMIT 1 (0.4ms) ROLLBACK (0.4ms) ROLLBACK => false
oauth_applications表是100%为空.
我在服务器上运行它(本地它按预期工作),如果您需要更多信息,请告诉我.
编辑:
我也尝试过:
$>app.save!
并得到以下错误:
ActiveRecord::RecordInvalid: Validation failed: Redirect URI must be an HTTPS/SSL URI.从以下错误组件:
Redirect URI must be an HTTPS/SSL URI
看来你正在为uri使用不安全(http,而不是https)端点.对于某些平台(如Heroku),会自动启用HTTPS支持,因此在uri中放置https://应该足够了.
对于ElasticBeanstalk,它不应该是一个非常麻烦的过程.请参阅their docs以开始使用.您需要从域名提供商处购买SSL证书,然后在ElasticBeanstalk Web配置中找到上传和使用证书的选项(我认为该选项可能位于负载均衡器部分).