从AngularJs / Cordova发布时的unable_to_verify_leaf_signature

时间:2015-08-21 13:04:19

标签: angularjs cordova ssl ripple identityserver3

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

enter image description here

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

enter image description here

我可以通过谷歌搜索得到的是它与证书有关,但我只能在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();
    });
};

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

更新:这实际上是一个涟漪模拟器还是cordova问题?

2 个答案:

答案 0 :(得分:-1)

我遇到了同样的问题并解决了让API与真正的主机一起工作的问题。似乎是Ripple的一个问题。

答案 1 :(得分:-1)

如果有人仍然遇到同样的问题,可能值得在Using the Apache Ripple emulator with a self signed SSL certificate

尝试我的Ripple解决方案

我将从上面的SO问题中添加我的答案的步骤,以防止进一步的downvotes:

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