authorization - Mobilefirst 插件不支持 Android 9 进行安全登录
问题描述
科尔多瓦-插件-mfp
在 Andoird 9 中使用时会为 WLAuthorizationManager.login 引发错误。
03-01 09:05:21.852 660 25727 I netd : ;; res_nquery(ukd-climf8.peluk.org, 1, 1)
03-01 09:05:22.527 25320 25454 D com.worklight.androidgap.plugin.ChallengeHandlerPlugin: ChallengeHandlerPlugin.execute in ChallengeHandlerPlugin.java:42 :: inside ChallengeHandlerPlugin execute for action createSecurityCheckChallengeHandler
03-01 09:05:22.528 25320 25538 W System.err: java.lang.Error: java.security.NoSuchAlgorithmException: The BC provider no longer provides an implementation for KeyPairGenerator.RSA. Please see https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html for more details.
03-01 09:05:22.529 25320 25538 W System.err: at com.worklight.wlclient.auth.WLAuthorizationManagerInternal.invokeRegistrationRequest(WLAuthorizationManagerInternal.java:751)
03-01 09:05:22.529 25320 25538 W System.err: at com.worklight.wlclient.auth.WLAuthorizationManagerInternal.invokeRegistrationRequest(WLAuthorizationManagerInternal.java:473)
03-01 09:05:22.529 28397 28397 I PhenotypeExpConfig: refreshConfiguration() : Force = false : UpdateAvailable = false : Age = 9 minutes : MaxAge = 720 minutes
03-01 09:05:22.529 25320 25538 W System.err: at com.worklight.wlclient.auth.WLAuthorizationManagerInternal.loginWithRegistration(WLAuthorizationManagerInternal.java:1294)
03-01 09:05:22.529 25320 25538 W System.err: at com.worklight.wlclient.auth.WLAuthorizationManagerInternal.login(WLAuthorizationManagerInternal.java:486)
03-01 09:05:22.530 28397 28397 I AndroidIME: PasswordIme.onDeactivate()
03-01 09:05:22.530 25320 25538 W System.err: at com.worklight.wlclient.api.WLAuthorizationManager.login(WLAuthorizationManager.java:125)
03-01 09:05:22.530 25320 25538 W System.err: at com.worklight.androidgap.plugin.WLAuthorizationManagerPlugin.execute(WLAuthorizationManagerPlugin.java:157)
03-01 09:05:22.530 25320 25538 W System.err: at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
03-01 09:05:22.530 25320 25538 W System.err: at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
03-01 09:05:22.530 25320 25538 W System.err: at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:57)
03-01 09:05:22.530 25320 25538 W System.err: at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
03-01 09:05:22.530 25320 25538 W System.err: at android.os.MessageQueue.nativePollOnce(Native Method)
03-01 09:05:22.531 25320 25538 W System.err: at android.os.MessageQueue.next(MessageQueue.java:326)
03-01 09:05:22.531 25320 25538 W System.err: at android.os.Looper.loop(Looper.java:160)
03-01 09:05:22.531 25320 25538 W System.err: at android.os.HandlerThread.run(HandlerThread.java:65)
03-01 09:05:22.531 25320 25538 W System.err: Caused by: java.security.NoSuchAlgorithmException: The BC provider no longer provides an implementation for KeyPairGenerator.RSA. Please see https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html for more details.
03-01 09:05:22.532 25320 25538 W System.err: at sun.security.jca.Providers.checkBouncyCastleDeprecation(Providers.java:563)
03-01 09:05:22.532 25320 25538 W System.err: at sun.security.jca.Providers.checkBouncyCastleDeprecation(Providers.java:330)
03-01 09:05:22.532 25320 25538 W System.err: at java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:303)
03-01 09:05:22.532 25320 25538 W System.err: at com.worklight.common.security.WLCertManager.generateKeyPair(WLCertManager.java:108)
03-01 09:05:22.532 25320 25454 D com.worklight.androidgap.plugin.ChallengeHandlerPlugin: ChallengeHandlerPlugin.execute in ChallengeHandlerPlugin.java:49 :: inside ChallengeHandlerPlugin createSecurityCheckChallengeHandler
03-01 09:05:22.532 25320 25538 W System.err: at com.worklight.common.security.WLOAuthCertManager.generateKeyPair(WLOAuthCertManager.java:80)
03-01 09:05:22.532 25320 25538 W System.err: at com.worklight.wlclient.auth.WLAuthorizationManagerInternal.signRegistrationData(WLAuthorizationManagerInternal.java:758)
03-01 09:05:22.532 25320 25538 W System.err: at com.worklight.wlclient.auth.WLAuthorizationManagerInternal.getRegistrationParams(WLAuthorizationManagerInternal.java:591)
03-01 09:05:22.532 25320 25538 W System.err: at com.worklight.wlclient.auth.WLAuthorizationManagerInternal.invokeRegistrationRequest(WLAuthorizationManagerInternal.java:711)
03-01 09:05:22.533 25320 25538 W System.err: ... 13 more
解决方案
此问题已在 Android 9 发布时得到解决。升级到最新的 IBM MobileFirst 客户端 SDK 以解决此问题。
推荐阅读
- amazon-web-services - AWS Cloudfront 分发保持“进行中”55 分钟并计数
- python - 页面重新加载后从输入框中获取文本
- python - 如何使用变量访问嵌套 python 字典中的键值?
- swift - 从 AXUIElementCopyAttributeValue 中找到一个窗口及其 windowNumber 以更改其位置
- php - 如何在两个实例(对象)中从网页中读取数据?
- c++ - GCC 和 Clang 未对未使用的异常变量发出警告
- aws-lambda - 可以使用 Alexa 托管技能调用 http 获取吗?
- python - python2 到 python3 的迁移问题与 unicode 和字节
- encryption - 3des密码解密的arduino代码问题
- javascript - 刷新时如何使网页滚动到页面顶部?