2015-08-21 25 views
0

我试图从我的angularjs authService使用“https://localhost:44333/identity/connect/token”发布到我的身份服务器时遇到以下错误,但是当我从Postman或Fiddler发布时,所有工作都正常。unableionto_verify_leaf_signature当从AngularJs /科尔多瓦发布

enter image description here

我有自己创建了我进口,所以当我在我的浏览器浏览到https://localhost:44333/identity一切都很好的证明。

enter image description here

我可以收集来自周围的Googling是,它必须是与证书什么的,但我只能找到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(); 
    }); 
}; 

任何的想法是什么,我丢失或如何解决这个问题?

更新:这实际上是一个涟漪模拟器或科尔多瓦问题?

回答

-1

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

想我纹波的解决方案,我会从上面的SO问题加我的答案的步骤,以防止进一步的downvotes:

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

虽然这可能在理论上回答这个问题,但[这将是更可取的](// meta.stackoverflow.com/q/8259)在这里包括答案的基本部分,并提供参考链接。 – Tunaki

-1

我有同样的问题,并解决获取API与真正的主机工作。似乎是Ripple的问题。

+0

您可以更明确地解释一下_and解析你的意思是让API与真正的host_一起工作。你的回答很难理解,谢谢。 – yacc

+1

对不起。我正面临着使用Visual Studio 2015 + Apache Cordova(Ripple)+ Web Api进行开发的相同问题,当您尝试获取令牌时,我面临同样的问题。我还注意到,使用Ripple进行测试返回的错误,然后我所做的就是将我的webapi移动到azure主机,得到一个真正的ssl,将我的cordova应用重定向到新的主机,然后消息消失。我真的相信这是一个涟漪问题。对不起,如果我的第一个答案令人困惑。如果你想了解更多信息,请问我。我会很乐意提供帮助。 – user3720916