基本身份验证科尔多瓦的ios失败 [英] Basic Authentication fails in cordova ios

查看:132
本文介绍了基本身份验证科尔多瓦的ios失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是想在一个混合移动iPhone应用程序使基本身份验证Ajax调用。 Ajax调用返回任何它只是挂起没有成功,也没有失败。但是,同样的Ajax调用火成功地从机器人。

I was trying to make an ajax call with basic authentication on a hybrid mobile ios application. The ajax call returns nothing it just hangs no success nor failure. But the same ajax call fires successfully from android.

虽然我被检查使用Wireshark传出请求我发现,认证头失踪,401是从我的服务器返回,并在后续调用认证头也一起发送它返回一个301的请求但是,它的工作原理与Android

While i was checking the outgoing request with wireshark i found that the authentication header is missing and a 401 is returning from my server and on subsequent call the authentication header is also send along with the request which returns a 301. But it works with android

相同的API工作正常,从我的开发服务器的ios,但未能在我的督促服务器

任何建议是AP preciated

Any Suggestions is appreciated

推荐答案

我使用的是科尔多瓦4.2.0。

I'm using cordova 4.2.0.

我观察到的情况下的401响应与WWW验证:基本头,IOS / UIWebView中似乎吞传递回给应用层,这给该服务的效果决不的响应,而不是响应。也许这是prevent验证的弹出窗口。

I have observed that in case of a 401 response with the "WWW-Authenticate: Basic" header, IOS/UIWebView seems to swallow the response instead of passing it back to the application layer, which gives the effect of the service never responding. Perhaps this is to prevent authentication popups.

在任何情况下的行为是完全出乎意料!

In any event the behavior is completely unexpected!

编辑:我发现了一个科尔多瓦错误报告对这个问题: https://开头的问题。 apache.org/jira/browse/CB-2415

edit: I found a cordova bug report for this problem: https://issues.apache.org/jira/browse/CB-2415

这篇关于基本身份验证科尔多瓦的ios失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆