🐛 Bug Report: Cookie Error

未关闭
#80 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

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

调研方向

先从 CallbackActivity.kt 和 WebAuthComponent.kt 中的 OAuth 回调路径开始,然后检查 Account.kt 中 stack trace 所示的 createOAuth2Session 调用附近的代码。使用链接的示例复现 Android 15 上的 Google 身份验证流程,并验证 callback 在不发生崩溃的情况下返回身份验证 cookie。

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

描述

bug
👟 Reproduction steps

When I try to auth with google in android the below error returns

code: https://github.com/202420505/APPWRITE-GOOGLE-AUTH

🔽LOG🔽

07-24 10:55:09.815 27458 27458 E AndroidRuntime: FATAL EXCEPTION: main
07-24 10:55:09.815 27458 27458 E AndroidRuntime: Process: me.moontree.test.appwrite.auth.app1, PID: 27458
07-24 10:55:09.815 27458 27458 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{me.moontree.test.appwrite.auth.app1/io.appwrite.views.CallbackActivity}: io.appwrite.exceptions.AppwriteException: Authentication cookie missing!
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4454)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4685)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:112)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:174)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:109)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:81)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2895)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:107)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:257)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:342)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:9634)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:619)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
07-24 10:55:09.815 27458 27458 E AndroidRuntime: Caused by: io.appwrite.exceptions.AppwriteException: Authentication cookie missing!
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at io.appwrite.services.Account$createOAuth2Session$3.invoke(Account.kt:1153)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at io.appwrite.services.Account$createOAuth2Session$3.invoke(Account.kt:1143)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at io.appwrite.WebAuthComponent$Companion.onCallback(WebAuthComponent.kt:85)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at io.appwrite.views.CallbackActivity.onCreate(CallbackActivity.kt:16)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:9363)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:9332)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1526)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4436)
07-24 10:55:09.815 27458 27458 E AndroidRuntime:        ... 13 more
👍 Expected behavior

It should return a proper cookies

👎 Actual Behavior

It actually returns a error and the app crashes

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Something else

🧱 Your Environment

I used android 15 in samsung One UI 7.0

Used Android SDK Latest Version (8.1.0)

👀 Have you spent some time to check if this issue has been raised before?
  • I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
主要语言
Kotlin
星标
156
派生
29
平均合并
8 小时 49 分钟
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

appwrite/sdk-for-android 的其他 Issue

查看 appwrite/sdk-for-android 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 发到你的邮箱

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