MaikuB / flutter_appauth

A Flutter wrapper for AppAuth iOS and Android SDKs
270 stars 243 forks source link

Set TaskAffinity leads to PlatformException #314

Closed floric closed 2 years ago

floric commented 2 years ago

Hey,

thanks for your great lib!

Currently we use the lib without any set "android:taskAffinity" successfully. To prevent task hijacking we evaluated to set "android:taskAffinity" to an empty string (to get a dynamic value during runtime) or a specific custom package name. Both ways lead to the following exception:

I/flutter (15982): │ ⛔ login error: PlatformException(authorize_and_exchange_code_failed, Failed to authorize: [error: null, description: User cancelled flow], null
, null) - stack: #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
I/flutter (15982): │ ⛔ #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:177:18)
I/flutter (15982): │ ⛔ <asynchronous suspension>
I/flutter (15982): │ ⛔ #2 MethodChannelFlutterAppAuth.authorizeAndExchangeCode (package:flutter_appauth_platform_interface/src/method_channel_flutter_appauth.d
art:34:43)
...

We are not 100 percent sure if it's possible at all to set a custom taskAffinity value together with this lib. Does the error make sense or did we miss something important?

Kind regads, Florian

MaikuB commented 2 years ago

Not one I can answer. The plugin delegates the heavy lifting to another Android library so you need to dig into its implementation details to find out more. If you can't find out anything then you may need to consider developing your own solution

floric commented 2 years ago

Not one I can answer. The plugin delegates the heavy lifting to another Android library so you need to dig into its implementation details to find out more. If you can't find out anything then you may need to consider developing your own solution

Thanks for your answer. :/ Ok, seems like we need to keep searching.