FormidableLabs / FormidableLabs/react-native-app-auth

Error: JSON deserialization error (Android)

未关闭
#752 8 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
question stale
主要语言
Java
星标
2.3k
派生
473
PR 合并指标
30 天内没有已合并 PR

描述

## Issue

I am getting `JSON deserialization error` with the following on Android **ONLY** - iOS is working as expected.

```
export const config = {
issuer: 'https://opentest.coros.com',
clientId: 'XXX',
clientSecret: 'XXX',
redirectUrl: `com.myapp.staging://oauth`,
scopes: ['userInfo', 'runData'],
serviceConfiguration: {
authorizationEndpoint: `https://opentest.coros.com/oauth2/authorize`,
tokenEndpoint: `https://opentest.coros.com/oauth2/accesstoken`,
revocationEndpoint: `https://opentest.coros.com/oauth2/deauthorize`,
}
}

const result = await authorize(config)
```

Response I am expecting (I got this via iOS as it works):
```
{
"refreshToken": "XXX",
"scopes": [],
"accessToken": "XXX",
"idToken": "",
"tokenAdditionalParameters": {
"openId": "XXX"
},
"tokenType": "",
"authorizeAdditionalParameters": {},
"accessTokenExpirationDate": "2022-08-19T10:24:57Z"
}
```
I have a hunch it's related to the `tokenAdditionalParameters` but I'm not 100% sure.

Worth noting I can't see any network request to COROS using Flipper.

---

## Environment

* **Your Identity Provider**: COROS (https://coros.com/)
* **Platform that you're experiencing the issue on**: `Android`
* **Are you using Expo?** No

贡献指南

打开贡献指南

调研方向

从 Android 路径 authorize(config) 开始,调查 COROS token 响应附近的 JSON 反序列化失败,尤其是 tokenAdditionalParameters。将 Android 的处理方式与正常工作的 iOS 响应进行比较;当 Android 上的授权成功并返回预期的 token 字段时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, react-native
领域
authentication, mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。