【问题标题】:POST /token 400 (Bad Request) with ember-cli and ember-simple-auth使用 ember-cli 和 ember-simple-auth 发布 /token 400(错误请求)
【发布时间】:2014-07-31 21:19:00
【问题描述】:

我刚刚使用 Cloud9 从https://github.com/simplabs/ember-cli-simple-auth-example 设置了示例,当我尝试登录时收到 400 Bad Request 错误。

我很确定这是因为 Cloud9 仅打开端口 80(如 http://log.simplabs.com/post/90339547725/using-ember-simple-auth-with-ember-cli 的此注释中所引用:

因为 OAuth 2.0 身份验证器默认使用相同的域 和端口将身份验证请求发送到 Ember.js 所在的位置 从您加载需要将其配置为使用http://localhost:3000 而是。

不幸的是,我不知道如何解决这个问题。有什么想法吗?

【问题讨论】:

    标签: authentication ember.js ember-cli


    【解决方案1】:

    将主机添加到配置中的白名单:

    window.ENV['simple-auth'] = {
      crossOriginWhitelist: ['http://some.other.domain:1234']
    }
    

    更多信息在Cross Origin Authorization section of the docs

    【讨论】:

    • 谢谢,不幸的是,我切换到 Angular 并且无法对此进行测试,但我感谢您提供了一个潜在的解决方案 - 如果其他人说它有效,我会将其标记为正确答案.
    • 别担心.. 前几天我也遇到了同样的问题 :) 祝 Angular 好运!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多