无法登录到 iOS 实际设备 MobileFirst 项目上的应用程序

Posted

技术标签:

【中文标题】无法登录到 iOS 实际设备 MobileFirst 项目上的应用程序【英文标题】:Cannot login to app on iOS actural Device MobileFirst Project 【发布时间】:2016-02-16 08:44:56 【问题描述】:

您好,我最近使用 IBM MobileFirst 7.1 开发了小型示例应用程序。我已经在模拟器上成功运行了应用程序,它能够完美登录而没有错误,但是当我在实际设备(ios 9.2)上测试时,应用程序无法登录这里是我收到的一些错误日志

    2016-02-16 15:31:39.847 YITCallCenter[3010:1041692] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:221 :: Sending request (http://10.12.11.59:10080/YITCallCenter/authorization/v1/clients/instance) with headers: 

    "Accept-Language" = "th-TH";
    "User-Agent" = "YITCallCenter/1.0 (iPhone; iOS 9.2.1; Scale/3.00)/WLNativeAPI/7.1.0.0";
    "X-Requested-With" = XMLHttpRequest;
    "x-wl-app-version" = "1.0";
    "x-wl-device-id" = "AACA3EB7-EEF1-429A-A9A7-597231D2C8B2";
    "x-wl-platform-version" = "7.1.0.0";

You can see the request body in the Analytics platform logs.
2016-02-16 15:31:39.855 YITCallCenter[3010:1041692] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper start] in WLAFHTTPRequestOperationManagerWrapper.m:332 :: Starting the request with URL http://10.12.11.59:10080/YITCallCenter/authorization/v1/clients/instance
2016-02-16 15:31:39.857 YITCallCenter[3010:1041692] [DEBUG] [WL_REQUEST] __42-[WLRequest sendRequest:path:withOptions:]_block_invoke in WLRequest.m:231 :: waiting for response... (Thread=<NSThread: 0x155d04d90>number = 1, name = main)
2016-02-16 15:31:39.860 YITCallCenter[3010:1041692] THREAD WARNING: ['WLAuthorizationManagerPlugin'] took '98.279053' ms. Plugin should use a background thread.
2016-02-16 15:31:39.933 YITCallCenter[3010:1041692] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFinished:] in WLAFHTTPRequestOperationManagerWrapper.m:345 :: Request Success
2016-02-16 15:31:39.935 YITCallCenter[3010:1041692] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFinished:] in WLAFHTTPRequestOperationManagerWrapper.m:346 :: Response Status Code : 200
2016-02-16 15:31:39.938 YITCallCenter[3010:1041692] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2016/01/25 08:04:23
2016-02-16 15:31:39.942 YITCallCenter[3010:1041692] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:365 :: Response Header: 
    "Content-Length" = 887;
    "Content-Type" = "application/json;charset=UTF-8";
    Date = "Tue, 16 Feb 2016 08:32:14 GMT";
    "X-Powered-By" = "Servlet/3.0";

Response Data: "certificate":"MIICfzCCAWegAwIBAgIJAPVYUEY0ukWzMA0GCSqGSIb3DQEBCwUAMGsxCzAJBgNVBAYTAklMMQswCQYDVQQIEwJJTDERMA8GA1UEBxMIU2hlZmF5aW0xDDAKBgNVBAoTA0lCTTEcMBoGA1UECxMTTW9iaWxlRmlyc3RQbGF0Zm9ybTEQMA4GA1UEAxMHTUZQIERldjAgFw0xNjAyMTYwODMyMTVaGA8yMDY2MDIxNjA4MzIxNVowWTEdMBsGCgmSJomT8ixkARkWDVlJVENhbGxDZW50ZXIxODA2BgoJkiaJk\/IsZAEBEyg2ODhiYzhkOGViYWNkNGY0M2FkYjBjMjE0NzQ0NjNiNTUwZDcwYWUwMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAM0NKuJEcSlRDEFxM6+rapjpLaNw89GH+IYF6uJy11dxJsyrwzveaD\/cLyhNrwp4riu+RpkJeFj\/JMwR1\/9dZNMCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAYaTY7AYVB\/jpRxsEHADCbzeUcSjr65qN\/0c6EgIJ3GTSXQOtpRl7ApdBot6GMeMSZbXQRFZc9OWtZ8V3ww7UOCwrWPY9RlykNqaH5ViPnTHTjBdrd0HrIb+HrK67E+FKWQhdeE5xL+YSGiQTB7IOunYCJbII91y+s\/MDwIQNppcG2FNKLoEoiDPBPnesjNXYa+sNaexXK4NhqosP8KNoac6IcOPoaLaAosnRWKd+y13vWxLCpu86UKbkA668SpUXky9I94X1NXJIFKlHKwzX4AuHji5JbkcnVLjm77rvmIujHLxrNn1LX9jTq\/ofFfiOF4ae752\/G6olUS5ln5O4SA=="
Status code=200
2016-02-16 15:31:39.944 YITCallCenter[3010:1041692] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:424 :: NSS object is null
2016-02-16 15:31:39.948 YITCallCenter[3010:1041692] [DEBUG] [CERTIFICATE_MANAGER] BOOL hasCertificateExpired(X509 *) in WLCertManager.m:647 :: Certificate currentDate: 2016-02-16 08:31:39 +0000, expiryDate: 1523-02-16 08:32:15 +0000
2016-02-16 15:31:39.951 YITCallCenter[3010:1041692] [WARN] [CERTIFICATE_MANAGER] BOOL hasCertificateExpired(X509 *) in WLCertManager.m:649 :: Certificate has expired. Certificate expired on: 1523-02-16 08:32:15 +0000, verified on: 2016-02-16 08:31:39 +0000
2016-02-16 15:31:39.954 YITCallCenter[3010:1041692] [DEBUG] [WL_AUTH] -[WLAuthorizationManager failRegistratioWithResponse:] in WLAuthorizationManager.m:866 :: Response does not contain a valid certificate and client Id. device registration failed
2016-02-16 15:31:39.967 YITCallCenter[3010:1041692] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed.
2016-02-16 15:31:39.978 YITCallCenter[3010:1041692] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed.
2016-02-16 15:31:39.986 YITCallCenter[3010:1041692] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2016/01/25 08:04:23
2016-02-16 15:31:40.001 YITCallCenter[3010:1041692] [DEBUG] [WORKLIGHT] -[NotificationEx loadingStop:] in NotificationEx.m:150 :: Loading stop
2016-02-16 15:31:40.002 YITCallCenter[3010:1042149] [DEBUG] [NONE] Client registration failed with error: "responseHeaders":,"status":200,"responseText":"Invalid response when registering application","invocationContext":null
2016-02-16 15:31:40.005 YITCallCenter[3010:1042108] [ERROR] [NONE] [/apps/services/api/YITCallCenter/iphone/query] failure. state: 200, response: undefined
2016-02-16 15:31:40.088 YITCallCenter[3010:1041692] THREAD WARNING: ['Notification'] took '84.625732' ms. Plugin should use a background thread.

我认为最有趣的错误是

[WL_AUTH] -[WLAuthorizationManager failRegistratioWithResponse:] in WLAuthorizationManager.m:866 :: Response does not contain a valid certificate and client Id. device registration failed

PS 我已经设置了 ipaddress 而不是 localhost

【问题讨论】:

【参考方案1】:

我在所有升级的 7.1 iOS mobilefirst 应用程序中都遇到了这个问题。我发现现在默认情况下 App Authenticity 已打开到 iOS 的 Basic(MobileFirst 7.1 中的新功能),因为我的 application-descriptor.xml 中有一个现有部分。从我的 application-descriptor.xml 中删除安全部分并重建和重新部署 wlapp 文件解决了我的问题。我遵循了这种方法。

How to disable app authenticity on IBM MobileFirst 7.1 remote server?

【讨论】:

【参考方案2】:

我建议尝试以下方法,如本答案所述:Unable to login to app on device or simulator after upgrade to iOS 9 and MobileFirst 7.1

更新 worklight.plist 中的主机值以匹配您尝试连接的服务器之一。然后看看它是否仍然失败。

【讨论】:

【参考方案3】:

我发现 Mobile First 本身存在错误,事实证明,当我将 iPhone 日历设置为公历时,应用程序能够登录。推荐IBM出补丁谢谢

【讨论】:

以上是关于无法登录到 iOS 实际设备 MobileFirst 项目上的应用程序的主要内容,如果未能解决你的问题,请参考以下文章

Apple Pay 沙盒测试器无法登录设备 iOS 10

在 iOS 设备中查看 Phonegap 的控制台登录

SharePoint 2016 的解决方法,其中用户在使用 https 连接时无法从 Apple iOS 设备登录

iOS Xcode 8.3 Facebook SDK 登录错误

WSO2 iOT iOS Agent无法登录

JQuery 在实际 IOS 设备上无法使用 Cordova 3.1.0,但可以在模拟器上使用