FormidableLabs / FormidableLabs/react-native-app-auth

Multiple calls to authorize() cause iOS to crash

Offen
#831 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
2.3k
Forks
473
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Issue

iOS app crashes if a call to `authorize()` has not yet been completed before another call to `authorize()` is made.

**NOTE:** This works perfectly on Android. Android *appears* to cancel any pre-existing `authorize()` calls when a new call is made.

### Use case
We have 2 auth flows implemented as 2 different policies in Azure B2C:
1. Sign Up with invite link sent by email, B2C_1A_SU_INVITE policy.
The invite link is a universal link that, when clicked, triggers the app to call `authorize()` using the B2C_1A_SU_INVITE url as the issuer and initiates our custom Sign Up flow in B2C.
2. Sign In, B2C_1A_SI_ONLY policy.
A user clicks on a button to initiate Sign In and the app calls `authorize()` using the B2C_1A_SI_ONLY url as the issuer and initiates a Sign In flow in B2C.

A user can begin to sign in (1st call to `authorize()`) and the browser appears with the B2C hosted page. If the user switches to their email and clicks on the Sign Up invite link while the Sign In browser is still active, the app crashes as soon as it attempts to display the Sign Up page (2nd call to `authorize()`).

Our config is standard:
```
const config = {
// USER_FLOW_NAME can be either B2C_1A_SI_ONLY or B2C_1A_SU_INVITE
issuer: 'https://.b2clogin.com/.onmicrosoft.com//v2.0',
clientId: '',
redirectUrl: 'com.myapp://redirect/url/', // the redirectUrl must end with a slash
scopes: ['openid', 'offline_access']
iosPrefersEphemeralSession: true
};
```

---

## Environment

* **Your Identity Provider**: `Azure AD B2C`
* **Platform that you're experiencing the issue on**: `iOS only`
* **Are you using Expo?** No
* **Version?** 7.0.0-rc2 (RN 0.70.4)

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den iOS-exklusiven Absturz mit zwei überlappenden authorize()-Aufrufen unter Verwendung der in der Issue beschriebenen Azure AD B2C-Konfiguration zu reproduzieren. Untersuche den iOS-Autorisierungsablauf und vergleiche die Behandlung eines zweiten Aufrufs mit dem Abbruchverhalten von Android; abgeschlossen ist die Aufgabe, wenn ein zweiter Aufruf nicht mehr abstürzt und der überlappende Ablauf konsistent behandelt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, ios, react-native
Bereich
authentication, mobile
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.