【问题标题】:unable_to_verify_leaf_signature when posting from AngularJs/Cordova从 AngularJs/Cordova 发帖时无法验证叶签名
【发布时间】:2015-11-15 10:37:09
【问题描述】:

我在尝试使用我的 angularjs authService 中的“https://localhost:44333/identity/connect/token”发布到我的身份服务器时遇到以下错误,但是当我从 Postman 或 Fiddler 发布时一切正常。

我自己创建了一个我导入的证书,所以当我在浏览器中导航到https://localhost:44333/identity 时,一切都很好。

我可以从谷歌搜索得到的是它与证书有关,但我只能在 node.js 上找到主题。我正在尝试从 angularjs 服务向 IdentityServer3 进行身份验证,我使用 owin 在上述 url 上自托管。

以下是我的 angulajs 登录代码:

var _login = function (credentials) {

    var user = { grant_type: 'password', username: credentials.userName, password: credentials.password, scope: 'salesApi' }

    var urlEncodedUrl = {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': 'Basic ' + base64Encoded
    };

    console.log(base64Encoded);

    $http.post(serviceBase + 'connect/token', { headers: urlEncodedUrl }, { data: user }).success(function (data, status, headers, config) {

        localStorageService.set('authorizationData', { bearerToken: data.access_token, userName: credentials.userName });

        _authentication.isAuth = true;
        _authentication.userName = credentials.userName;
        _authentication.bearerToken = data.access_token;


    }).error(function (err, status) {
        console.log(err);
        _logOut();
    });
};

关于我缺少什么或如何解决此错误的任何想法?

更新:这实际上是波纹模拟器还是科尔多瓦问题?

【问题讨论】:

    标签: angularjs cordova ssl ripple identityserver3


    【解决方案1】:

    如果还有人遇到同样的问题,可能值得在Using the Apache Ripple emulator with a self signed SSL certificate尝试我的 Ripple 解决方案

    我将从上述 SO 问题中添加我的回答步骤,以防止进一步的否决:

    1. 创建一个快捷方式来运行带有 --disable-web-security 标志的 Chrome。如果需要更多信息,请参阅我的回答Visual Studio, Ripple Emulator and CORS/Cross Domain Ajax
    2. 使用命令行或 Visual Studio 启动 Ripple
    3. 使用 1 中的快捷方式启动 Chrome 实例。
    4. 浏览到您的 Ripple 网址并通过 HTTPS 发出您的请求
    5. 这将失败,开发工具控制台将显示 POST https://mydomain:port/api_endpoint net::ERR_INSECURE_RESPONSE
    6. 在新标签页中浏览到您的 https://mydomain:port 网址
    7. 这将导致“您的连接不是私人的”网页。点击“高级”,然后点击“继续https://mydomain:port(不安全)”以接受自签名 SSL
    8. 现在回到 Ripple 选项卡,再次尝试发出您的请求,应该会成功。

    【讨论】:

    • 虽然理论上可以回答这个问题,it would be preferable 在这里包含答案的基本部分,并提供链接以供参考。
    【解决方案2】:

    我遇到了同样的问题并解决了获取 API 以与真实主机一起使用的问题。似乎是 Ripple 的问题。

    【讨论】:

    • 您能否更明确地解释一下您的意思,并解决了让 API 与真实主机一起工作的问题。您的回答很难理解,谢谢。
    • 很抱歉。我在使用 Visual Studio 2015 + Apache Cordova (Ripple) + Web Api 开发时遇到了同样的问题,并且我在尝试获取令牌时遇到了同样的问题。我还注意到,使用 Ripple 进行测试会返回该错误,然后我所做的就是将我的 webapi 移动到 azure 主机,获得一个真正的 ssl,将我的科尔多瓦应用程序重定向到新主机,然后该消息就消失了。我真的相信这是一个涟漪问题。对不起,如果我的第一个答案令人困惑。如果您想了解更多信息,请询问我。我很乐意提供帮助。
    猜你喜欢
    • 2013-12-03
    • 2015-11-05
    • 1970-01-01
    • 2011-11-27
    • 2020-08-18
    • 1970-01-01
    • 2016-06-13
    • 1970-01-01
    相关资源
    最近更新 更多