Cordova Android应用程序获取“invalid_client”来自MobileFirst 8.0服务器 [英] Cordova Android application getting "invalid_client" from MobileFirst 8.0 server
问题描述
与IBM MobileFirst v8集成的我的Cordova IOS应用程序运行良好。但是我在 Android 时面临一个奇怪的问题。
My Cordova IOS application integrated with IBM MobileFirst v8 works fine. However I face a weird issue with Android.
场景是,
用户必须登录安全检查才能访问应用程序。
The scenario is, The user has to login into security check to access the application.
调用质询处理程序并将凭据提交给(runtime / api / preauth / v1 / preauthorize)。我在日志中看到安全检查已通过。
The challenge handler is called and credentials are submitted to (runtime/api/preauth/v1/preauthorize). I see in the logs security check is passed.
我可以看到下一次授权终点调用(runtime / api / az / v1 / authorization)
I can see the next call to authorization end point (runtime/api/az/v1/authorization)
但是我看到传递到此终点的参数与Android和IOS之间存在差异。
However I see a difference between Android and IOS in the parameters passed to this end point.
Android
response_type=code
scope=
client_id=
redirect_uri=http://mfpredirecturi&isAjaxRequest=true&x=0.9217767383903592
对于Android,后续的令牌生成终点调用失败。
/ runtime / api / az / v1 / token HTTP / 1.1400
{status:400,errorCode:invalid_client,description:JWT格式不正确}
The subsequent call to token generation end point fails for Android alone. /runtime/api/az/v1/token HTTP/1.1" 400 {status: 400, errorCode: "invalid_client", description: "Incorrect JWT format"}
IOS
response_type=code
scope=
client_id=
redirect_uri=http%3A//mfpredirecturi
WLAuthorizationManager.login(SECURITY_CHECK_NAME,凭证)触发/预授权电话
WLAuthorizationManager.login(SECURITY_CHECK_NAME, credential) triggers /preauthorize call
cordova-mfp-plugin(8.0.2016110713)
cordova-android(5.2.0)
cordova-mfp-plugin (8.0.2016110713) cordova-android (5.2.0)
我的主要嫌疑人是redirect_uri,它不是单独为Android编码的。导致问题的是吗?是否可以编码并从cordova应用程序发送redirect_uri?
my primary suspect is redirect_uri which is not encoded for Android alone. is the one causing the problem? is it possible to encode and send the redirect_uri from cordova application?
推荐答案
您可以在pom.xml中尝试更新的MFP适配器插件
You can try newer MFP adapter plugin in your pom.xml
<build>
<plugins>
<plugin>
<groupId>com.ibm.mfp</groupId>
<artifactId>adapter-maven-plugin</artifactId>
<version>8.0.2017021701</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
此适配器插件版本正常工作。
This adapter plugin version works fine.
这篇关于Cordova Android应用程序获取“invalid_client”来自MobileFirst 8.0服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!