android - Cordova Android 应用程序从 MobileFirst 8.0 服务器获取 "invalid_client"

标签 android cordova oauth-2.0 ibm-mobilefirst mobilefirst-server

我与 IBM MobileFirst v8 集成的 Cordova IOS 应用程序运行良好。但是,我在使用 Android 时遇到了一个奇怪的问题。

场景是, 用户必须登录安全检查才能访问该应用程序。

调用质询处理程序并将凭证提交到 (runtime/api/preauth/v1/preauthorize)。我在日志中看到安全检查已通过。

我可以看到下一次调用授权端点(runtime/api/az/v1/authorization)

但是我看到传递给这个端点的参数在 Android 和 IOS 之间存在差异。

安卓

    response_type=code
    scope=
    client_id=
    redirect_uri=http://mfpredirecturi&isAjaxRequest=true&x=0.9217767383903592

后续对 token 生成端点的调用仅针对 Android 失败。 /runtime/api/az/v1/token HTTP/1.1"400 {status: 400, errorCode: "invalid_client", description: "不正确的 JWT 格式"}

iOS

    response_type=code
    scope=
    client_id=
    redirect_uri=http%3A//mfpredirecturi

WLAuthorizationManager.login(SECURITY_CHECK_NAME, credential) 触发/preauthorize 调用

cordova-mfp-插件 (8.0.2016110713) Cordova 安卓(5.2.0)

我的主要怀疑是 redirect_uri,它不是单独为 Android 编码的。是导致问题的原因吗?是否可以从 cordova 应用程序编码和发送 redirect_uri?

最佳答案

您可以尝试更新的 MFP 适配器插件 在你的 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>

这个适配器插件版本工作正常。

关于android - Cordova Android 应用程序从 MobileFirst 8.0 服务器获取 "invalid_client",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41245086/

相关文章:

android - 动态改变数组的大小

android - Android Studio/Gradle无法为x86_64构建共享库

javascript - Phonegap 后退按钮我 android 没有捕获

java - 使用 Oath 对 Google 网站中的 contentfeed 执行查询时 token 无效

oauth-2.0 - 微服务中的授权和认证——好方法

security - 了解oauth 2.0中客户端id、客户端 key 的需求

android - 在edittext android中显示值时有双引号

android - 如何在 Jetpack Compose 中将图像 URL 设置为线圈上的错误占位符

cordova - 如何对 Ionic 项目中的 config.xml 进行持久更改

javascript - 处理 SQL 时出错 : TypeError: window. openDatabase 不是函数