flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

🐛 [App Check] App Check Returns Same Token Value

Open sithu-aung opened this issue 2 years ago • 5 comments

Bug report

App Check Returns Same Token Value of "eyJlcnJvciI6IlVOS05PV05fRVJST1IifQ==" in getToken Function.

Steps to reproduce

  1. Even using flutter app check example code make getToken() function return same value.

Sample project

https://pub.dev/packages/firebase_app_check/example

--

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.0.4, on macOS 12.4 21F5058e darwin-arm, locale en-MM) [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) [✓] Chrome - develop for the web [!] Android Studio ✗ Unable to find bundled Java version. [✓] Android Studio (version 2021.2) [✓] VS Code (version 1.68.1) [✓] Connected device (4 available) [✓] HTTP Host Availability

! Doctor found issues in 1 category.

sithu-aung avatar Jul 07 '22 08:07 sithu-aung

Thanks for the report. I see the same behavior running plugin example, ie, after activating and then clicking on getToken(), I see same token being generated.

darshankawar avatar Jul 07 '22 11:07 darshankawar

Yes @darshankawar . Please let me know if you found any fix or trick to this issue.

sithu-aung avatar Jul 08 '22 14:07 sithu-aung

A different token might be generated if the apk is signed by the Google PlayStore. https://github.com/firebase/flutterfire/discussions/7998#discussioncomment-2815263

KoheiKanagu avatar Aug 23 '22 09:08 KoheiKanagu

I have the same problem on Android, but when using the DebugAppCheckProviderFactory and debug token, I can get the normal token.

kapibara91 avatar Aug 28 '22 07:08 kapibara91

I ran into the same problem and this fixed it for me: https://stackoverflow.com/a/73330541/4595843

@sithu-aung @darshankawar

letthewookieewin avatar Sep 08 '22 23:09 letthewookieewin

Please use the latest API for activating app check: https://github.com/firebase/flutterfire/pull/9646. In any event, the same token being returned is coming from the native SDK, so I'd assume it is a user setup issue.

russellwheatley avatar Nov 16 '22 13:11 russellwheatley

Please use the latest API for activating app check: #9646. In any event, the same token being returned is coming from the native SDK, so I'd assume it is a user setup issue.

Thank you @russellwheatley!

letthewookieewin avatar Nov 16 '22 20:11 letthewookieewin