Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Venkatesh63740 opened this issue Jun 26, 2024 · 4 comments
Labels
needs-more-info This issue may not have sufficient information for a contributor to take action

Comments

@Venkatesh63740
Copy link

Venkatesh63740 commented Jun 26, 2024

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")

please anyone provide a fix.

@carbonrobot
Copy link
Contributor

Please submit the details of your bug report or we will not be able to help you troubleshoot the issue.

See https://github.com/FormidableLabs/react-native-app-auth/blob/main/.github/ISSUE_TEMPLATE/Bug_Report.md for information.

@carbonrobot carbonrobot added the needs-more-info This issue may not have sufficient information for a contributor to take action label Jun 26, 2024
@Venkatesh63740
Copy link
Author

Venkatesh63740 commented Jun 27, 2024

Uploading MicrosoftTeams-video.mp4…
after the login it is redirect to the app it shows two application and when we click the the 1st app
it shows this error
{"nativeStackAndroid":[],"userInfo":null,"message":"Parameter grant_type is directly supported via the authorization request builder, use the builder method instead","code":"run_time_exception"}

if we click 2nd app it shows this error {"nativeStackAndroid":[],"userInfo":null,"message":"User cancelled flow","code":"authentication_error"}.

<uses-permission android:name="android.permission.INTERNET" />

<activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:exported="true"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
    android:launchMode="singleTask"
    android:windowSoftInputMode="adjustResize">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

<activity
        android:name="net.openid.appauth.RedirectUriReceiverActivity"
        android:exported="true">
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
              <data android:scheme="https"
              android:host="com.example.app""
              android:path="/callback"/>
    </intent-filter>
</activity>

Please submit the details of your bug report or we will not be able to help you troubleshoot the issue.

See https://github.com/FormidableLabs/react-native-app-auth/blob/main/.github/ISSUE_TEMPLATE/Bug_Report.md for information.

@carbonrobot
Copy link
Contributor

Each provider has specific configurations that are required. Without knowing your configuration, it will be difficult to help you. Please provide the information required in the Bug Report Template.

@Venkatesh63740
Copy link
Author

Venkatesh63740 commented Jun 27, 2024

MicrosoftTeams-video.mp4

using react native 0.66 and "react-native-app-auth": "^6.4.3",

Androidmanefist.xml

<uses-permission android:name="android.permission.INTERNET" />

<activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:exported="true"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
    android:launchMode="singleTask"
    android:windowSoftInputMode="adjustResize">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

<activity
    android:name="net.openid.appauth.AuthorizationManagementActivity"
   >
    <intent-filter >
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="com.example.appname" android:host="callback" />
    </intent-filter>
</activity>

build.gradle:
manifestPlaceholders = [appAuthRedirectScheme: "com.example.appname"]

my config:
{
"additionalParameters": {
"grant_type": "authorization_code"
},
"clientId": "{clientid}",
"clientSecret": "{secretkey}",
"issuer": "https://{myoktasiteurl}/oauth2/default",
"redirectUrl": "com.example.appname:/callback",
"responseTypes": "code",
"scopes": [
"openid",
"profile",
"offline_access"
],
"serviceConfiguration": {
"authorizationEndpoint": "https://{myoktasiteurl}/oauth2/default/v1/authorize",
"endSessionEndpoint": "https:/{myoktasiteurl}/oauth2/default/v1/logout",
"tokenEndpoint": "https://{myoktasiteurl}/oauth2/default/v1/token"
},
"useNonce": false,
"usePKCE": true
}

working fine in iOS but android, it was not redirecting to my app after the login and after while login the okta site from the app if we close and open the app it shows {"nativeStackAndroid":[],"userInfo":null,"message":"User cancelled flow","code":"authentication_error"}

This is iOS config:

CFBundleURLName $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleURLSchemes {myoktasiteurl}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-more-info This issue may not have sufficient information for a contributor to take action
Projects
None yet
Development

No branches or pull requests

2 participants