FormidableLabs / FormidableLabs/react-native-app-auth

Multiple calls to authorize() cause iOS to crash

Aperta
#831 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
2.3k
Fork
473
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo il crash esclusivo di iOS con due chiamate sovrapposte a authorize(), usando la configurazione Azure AD B2C descritta nell’issue. Esamina il flusso di autorizzazione di iOS e confronta la gestione di una seconda chiamata con il comportamento di annullamento di Android; il lavoro è completato quando una seconda chiamata non causa più un crash e il flusso sovrapposto viene gestito in modo coerente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, ios, react-native
Ambito
authentication, mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.