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
1.96k stars 438 forks source link

Android - Getting User Cancelled when clicking login with azure b2c #949

Closed arsencenko closed 1 month ago

arsencenko commented 4 months ago

I'm using react-native-app-auth example to get access token from azure ad b2c but I'm facing issues in android. Unable to complete authorization as there is no interactive call in progress. This can be due to closing the app while the authorization was in process. Screenshot

Screenshot 2024-02-29 at 10 09 57 PM

Config

identityserver: {
    issuer:
      'https://cocentricsso.b2clogin.com/cocentricsso.onmicrosoft.com/oauth2/v2.0',
    clientId: 'clientid',
    redirectUrl:
      Platform.OS == 'ios'
        ? 'msauth.com.example://auth'
        : 'msauth://com.example/2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D',
    scopes: ['openid'],
    serviceConfiguration: {
      authorizationEndpoint:
        'https://cocentricsso.b2clogin.com/cocentricsso.onmicrosoft.com/B2C_1A_SIGNIN_USERNAMEOREMAIL/oauth2/v2.0/authorize/',
      tokenEndpoint:
        'https://cocentricsso.b2clogin.com/cocentricsso.onmicrosoft.com/B2C_1A_SIGNIN_USERNAMEOREMAIL/oauth2/v2.0/token/',
      revocationEndpoint:
        'https://cocentricsso.b2clogin.com/cocentricsso.onmicrosoft.com/B2C_1A_SIGNIN_USERNAMEOREMAIL/oauth2/v2.0/logout/',
    },
  },

Environment

"react": "18.2.0",
"react-native": "0.72.4",
"react-native-app-auth": "7.1.3"
carbonrobot commented 1 month ago

That error originates from the MSAL service itself, please recheck your settings for the service. You can also review this issue for additional tips: https://github.com/openid/AppAuth-Android/issues/704