You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1387,6 +1388,66 @@ If you want to support multiple domains, you would have to pass an array of obje
1387
1388
1388
1389
You can skip sending the `customScheme` property if you do not want to customize it.
1389
1390
1391
+
## Allowed Browsers (Android)
1392
+
1393
+
On Android, some browsers do not correctly handle App Link redirects. For example, Firefox renders the callback URL as a web page instead of handing the redirect back to your app, causing the authentication flow to fail silently.
1394
+
1395
+
You can restrict which browsers are allowed to handle the web authentication flow by passing `allowedBrowserPackages` in the options object. When set, only browsers whose package names appear in the list will be used.
1396
+
1397
+
**Behaviour:**
1398
+
- If the user's default browser is in the list, it is used.
1399
+
- If the user's default browser is not in the list but another allowed browser is installed, that browser is used instead.
1400
+
- If no allowed browser is installed, an `a0.browser_not_available` error is returned.
1401
+
1402
+
> **Platform Support:** Android only. This option is ignored on iOS.
1403
+
1404
+
### Using with Hooks
1405
+
1406
+
```typescript
1407
+
import { useAuth0 } from'react-native-auth0';
1408
+
1409
+
const { authorize } =useAuth0();
1410
+
1411
+
awaitauthorize(
1412
+
{ scope:'openid profile email' },
1413
+
{
1414
+
allowedBrowserPackages: [
1415
+
'com.android.chrome',
1416
+
'com.chrome.beta',
1417
+
'com.microsoft.emmx', // Edge
1418
+
'com.brave.browser',
1419
+
'com.sec.android.app.sbrowser', // Samsung Internet
1420
+
],
1421
+
}
1422
+
);
1423
+
```
1424
+
1425
+
### Using with Auth0 Class
1426
+
1427
+
```typescript
1428
+
importAuth0from'react-native-auth0';
1429
+
1430
+
constauth0=newAuth0({
1431
+
domain:'YOUR_AUTH0_DOMAIN',
1432
+
clientId:'YOUR_AUTH0_CLIENT_ID',
1433
+
});
1434
+
1435
+
awaitauth0.webAuth.authorize(
1436
+
{ scope:'openid profile email' },
1437
+
{
1438
+
allowedBrowserPackages: [
1439
+
'com.android.chrome',
1440
+
'com.chrome.beta',
1441
+
'com.microsoft.emmx', // Edge
1442
+
'com.brave.browser',
1443
+
'com.sec.android.app.sbrowser', // Samsung Internet
1444
+
],
1445
+
}
1446
+
);
1447
+
```
1448
+
1449
+
The same `allowedBrowserPackages` option is also accepted by `clearSession` to restrict which browser handles the logout flow.
1450
+
1390
1451
## DPoP (Demonstrating Proof-of-Possession)
1391
1452
1392
1453
[DPoP](https://datatracker.ietf.org/doc/html/rfc9449) (Demonstrating Proof-of-Possession) is an OAuth 2.0 extension that cryptographically binds access and refresh tokens to a client-specific key pair. This prevents token theft and replay attacks by ensuring that even if a token is intercepted, it cannot be used from a different device.
0 commit comments