FormidableLabs / react-native-app-auth

React native bridge for AppAuth - an SDK for communicating with OAuth2 providers
https://commerce.nearform.com/open-source/react-native-app-auth
MIT License
2.03k stars 441 forks source link

nativeStackAndroid | Android Error: User cancelled flow Java error #651

Closed edx-mohamed-khamis closed 2 years ago

edx-mohamed-khamis commented 3 years ago

Issue

So I am using an open source code mattermost-mobile) in iOS it works fine. but in android i am getting this message in the catch of authorize method.

if I am not using JSON.stringify this is what i get: Error: User cancelled flow.

if I use JSON.stringify this is what i get:

JSON

{
   "nativeStackAndroid":[
      {
         "methodName":"onActivityResult",
         "lineNumber":411,
         "file":"RNAppAuthModule.java",
         "class":"com.rnappauth.RNAppAuthModule"
      },
      {
         "methodName":"onActivityResult",
         "lineNumber":305,
         "file":"ReactContext.java",
         "class":"com.facebook.react.bridge.ReactContext"
      },
      {
         "methodName":"onActivityResult",
         "lineNumber":762,
         "file":"ReactInstanceManager.java",
         "class":"com.facebook.react.ReactInstanceManager"
      },
      {
         "methodName":"onActivityResult",
         "lineNumber":70,
         "file":"ReactGateway.java",
         "class":"com.reactnativenavigation.react.ReactGateway"
      },
      {
         "methodName":"onActivityResult",
         "lineNumber":101,
         "file":"NavigationActivity.java",
         "class":"com.reactnativenavigation.NavigationActivity"
      },
      {
         "methodName":"dispatchActivityResult",
         "lineNumber":8110,
         "file":"Activity.java",
         "class":"android.app.Activity"
      },
      {
         "methodName":"deliverResults",
         "lineNumber":4838,
         "file":"ActivityThread.java",
         "class":"android.app.ActivityThread"
      },
      {
         "methodName":"handleSendResult",
         "lineNumber":4886,
         "file":"ActivityThread.java",
         "class":"android.app.ActivityThread"
      },
      {
         "methodName":"execute",
         "lineNumber":51,
         "file":"ActivityResultItem.java",
         "class":"android.app.servertransaction.ActivityResultItem"
      },
      {
         "methodName":"executeCallbacks",
         "lineNumber":135,
         "file":"TransactionExecutor.java",
         "class":"android.app.servertransaction.TransactionExecutor"
      },
      {
         "methodName":"execute",
         "lineNumber":95,
         "file":"TransactionExecutor.java",
         "class":"android.app.servertransaction.TransactionExecutor"
      },
      {
         "methodName":"handleMessage",
         "lineNumber":2016,
         "file":"ActivityThread.java",
         "class":"android.app.ActivityThread$H"
      },
      {
         "methodName":"dispatchMessage",
         "lineNumber":107,
         "file":"Handler.java",
         "class":"android.os.Handler"
      },
      {
         "methodName":"loop",
         "lineNumber":214,
         "file":"Looper.java",
         "class":"android.os.Looper"
      },
      {
         "methodName":"main",
         "lineNumber":7356,
         "file":"ActivityThread.java",
         "class":"android.app.ActivityThread"
      },
      {
         "methodName":"invoke",
         "lineNumber":-2,
         "file":"Method.java",
         "class":"java.lang.reflect.Method"
      },
      {
         "methodName":"run",
         "lineNumber":492,
         "file":"RuntimeInit.java",
         "class":"com.android.internal.os.RuntimeInit$MethodAndArgsCaller"
      },
      {
         "methodName":"main",
         "lineNumber":930,
         "file":"ZygoteInit.java",
         "class":"com.android.internal.os.ZygoteInit"
      }
   ],
   "userInfo":null,
   "message":"User cancelled flow",
   "code":"authentication_error",
   "line":2267,
   "column":45,
   "sourceURL":"http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mattermost.rnbeta&modulesOnly=false&runModule=true"
}

Environment

Video: https://user-images.githubusercontent.com/68809241/125577861-99567228-3cca-4889-a9f7-32266b91957a.MOV

Abbasbufurnas commented 3 years ago

I have the same issue

edx-mohamed-khamis commented 3 years ago

@kadikraman

edx-mohamed-khamis commented 3 years ago

@janpieterz @hakonk @jpdriver

rezaarifian commented 3 years ago

I have the same issue

edx-mohamed-khamis commented 3 years ago

@rezaarifian use this code Customized as you need and it will work the community is dead

badgeek commented 3 years ago

@rezaarifian use this code Customized as you need and it will work the community is dead

could you point out the code to fix this?

badgeek commented 3 years ago

@rezaarifian use this code Customized as you need and it will work the community is dead

could you point out the code to fix this?

@khamisEDX

thanks!

Jay-A-McBee commented 2 years ago

Closing due to lack of information - feel free to open a new issue.

Venkatesh63740 commented 4 months ago

{"nativeStackAndroid":[],"userInfo":null,"message":"User cancelled flow","code":"authentication_error"} shared image

using version 5.1.3 react native 0.66. and used 7.2.0 latest version of npm but the issue is not resolved.("react-native-app-auth")

carbonrobot commented 4 months ago

@Venkatesh63740 This issue is closed, if you are experiencing issues please open a new issue with reproduction and which provider you are using.