Skip to content

Commit d64f194

Browse files
Merge branch 'master' of https://github.com/auth0/react-native-auth0 into beta
2 parents 4a73548 + 8dbb863 commit d64f194

81 files changed

Lines changed: 30351 additions & 24486 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
release:
1919
uses: ./.github/workflows/npm-release.yml
2020
with:
21-
node-version: 18
21+
node-version: 20
2222
require-build: false
2323
secrets:
2424
npm-token: ${{ secrets.NPM_TOKEN }}

.snyk

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,71 @@ ignore:
55
SNYK-JS-INFLIGHT-6095116:
66
- '*':
77
reason: No fix available
8-
expires: 2025-04-12T09:15:05.191Z
8+
expires: 2025-05-12T09:15:05.191Z
99
created: 2025-02-02T05:47:18.380Z
1010
SNYK-JS-BABELHELPERS-9397697:
1111
- '*':
1212
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
13-
expires: 2025-04-12T09:15:05.191Z
13+
expires: 2025-05-12T09:15:05.191Z
1414
created: 2025-03-12T09:15:05.191Z
15+
SNYK-JS-IMAGESIZE-9634164:
16+
- '*':
17+
reason: This issue is temporarily ignored untill there is a new release of react native fixed this issue.
18+
expires: 2025-05-12T09:15:05.191Z
19+
created: 2025-04-07T09:15:05.191Z
1520
snyk:lic:npm:lightningcss-win32-x64-msvc:MPL-2.0:
1621
- '*':
1722
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
18-
expires: 2025-04-12T09:15:05.191Z
23+
expires: 2025-05-12T09:15:05.191Z
1924
created: 2025-03-12T09:15:05.191Z
2025
snyk:lic:npm:lightningcss-linux-x64-musl:MPL-2.0:
2126
- '*':
2227
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
23-
expires: 2025-04-12T09:15:05.191Z
28+
expires: 2025-05-12T09:15:05.191Z
2429
created: 2025-03-12T09:15:05.191Z
2530
snyk:lic:npm:lightningcss-linux-x64-gnu:MPL-2.0:
2631
- '*':
2732
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
28-
expires: 2025-04-12T09:15:05.191Z
33+
expires: 2025-05-12T09:15:05.191Z
2934
created: 2025-03-12T09:15:05.191Z
3035
snyk:lic:npm:lightningcss-linux-arm64-musl:MPL-2.0:
3136
- '*':
3237
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
33-
expires: 2025-04-12T09:15:05.191Z
38+
expires: 2025-05-12T09:15:05.191Z
3439
created: 2025-03-12T09:15:05.191Z
3540
snyk:lic:npm:lightningcss-linux-arm64-gnu:MPL-2.0:
3641
- '*':
3742
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
38-
expires: 2025-04-12T09:15:05.191Z
43+
expires: 2025-05-12T09:15:05.191Z
3944
created: 2025-03-12T09:15:05.191Z
4045
snyk:lic:npm:lightningcss-linux-arm-gnueabihf:MPL-2.0:
4146
- '*':
4247
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
43-
expires: 2025-04-12T09:15:05.191Z
48+
expires: 2025-05-12T09:15:05.191Z
4449
created: 2025-03-12T09:15:05.191Z
4550
snyk:lic:npm:lightningcss-freebsd-x64:MPL-2.0:
4651
- '*':
4752
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
48-
expires: 2025-04-12T09:15:05.191Z
53+
expires: 2025-05-12T09:15:05.191Z
4954
created: 2025-03-12T09:15:05.191Z
5055
snyk:lic:npm:lightningcss-darwin-x64:MPL-2.0:
5156
- '*':
5257
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
53-
expires: 2025-04-12T09:15:05.191Z
58+
expires: 2025-05-12T09:15:05.191Z
5459
created: 2025-03-12T09:15:05.191Z
5560
snyk:lic:npm:lightningcss-darwin-arm64:MPL-2.0:
5661
- '*':
5762
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
58-
expires: 2025-04-12T09:15:05.191Z
63+
expires: 2025-05-12T09:15:05.191Z
5964
created: 2025-03-12T09:15:05.191Z
6065
snyk:lic:npm:lightningcss:MPL-2.0:
6166
- '*':
6267
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
63-
expires: 2025-04-12T09:15:05.191Z
68+
expires: 2025-05-12T09:15:05.191Z
6469
created: 2025-03-12T09:15:05.191Z
6570
snyk:lic:npm:lightningcss-win32-arm64-msvc:MPL-2.0:
6671
- '*':
6772
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
68-
expires: 2025-04-12T09:15:05.191Z
73+
expires: 2025-05-12T09:15:05.191Z
6974
created: 2025-03-12T09:15:05.191Z
7075
patch: {}

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v4.4.0
1+
v4.5.0

A0Auth0.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Pod::Spec.new do |s|
1818
s.requires_arc = true
1919

2020
s.dependency 'React-Core'
21-
s.dependency 'Auth0', '2.7.2'
22-
s.dependency 'JWTDecode', '3.1.0'
23-
s.dependency 'SimpleKeychain', '1.1.0'
21+
s.dependency 'Auth0', '2.10'
22+
s.dependency 'JWTDecode', '3.2.0'
23+
s.dependency 'SimpleKeychain', '1.2.0'
2424

2525
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
2626
s.pod_target_xcconfig = {

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Change Log
22

3+
## [v4.5.0](https://github.com/auth0/react-native-auth0/tree/v4.5.0) (2025-04-17)
4+
5+
[Full Changelog](https://github.com/auth0/react-native-auth0/compare/v4.4.0...v4.5.0)
6+
7+
**Added**
8+
9+
- Update dependencies and enhance webAuth methods to support HTTPS [\#1125](https://github.com/auth0/react-native-auth0/pull/1125) ([subhankarmaiti](https://github.com/subhankarmaiti))
10+
- feat: add optional timeout prop to Auth0Provider for authentication requests [\#1124](https://github.com/auth0/react-native-auth0/pull/1124) ([subhankarmaiti](https://github.com/subhankarmaiti))
11+
- Updated Readme recommending App links [\#1094](https://github.com/auth0/react-native-auth0/pull/1094) ([pmathew92](https://github.com/pmathew92))
12+
13+
**Fixed**
14+
15+
- Added deviceCredentialFallback default value [\#1098](https://github.com/auth0/react-native-auth0/pull/1098) ([subhankarmaiti](https://github.com/subhankarmaiti))
16+
17+
**Security**
18+
19+
- fix: TypeDoc configuration and update dependencies [\#1139](https://github.com/auth0/react-native-auth0/pull/1139) ([subhankarmaiti](https://github.com/subhankarmaiti))
20+
- React Native Bob Builder config update for expo [\#1137](https://github.com/auth0/react-native-auth0/pull/1137) ([subhankarmaiti](https://github.com/subhankarmaiti))
21+
- Dependency version upgrades [\#1113](https://github.com/auth0/react-native-auth0/pull/1113) ([subhankarmaiti](https://github.com/subhankarmaiti))
22+
- Dependency and config update as per react-native-builder-bob [\#1097](https://github.com/auth0/react-native-auth0/pull/1097) ([subhankarmaiti](https://github.com/subhankarmaiti))
23+
324
## [v4.4.0](https://github.com/auth0/react-native-auth0/tree/v4.4.0) (2025-02-19)
425

526
[Full Changelog](https://github.com/auth0/react-native-auth0/compare/v4.3.0...v4.4.0)

EXAMPLES.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@
88
- [Login using MFA with One Time Password code](#login-using-mfa-with-one-time-password-code)
99
- [Login with Passwordless](#login-with-passwordless)
1010
- [Create user in database connection](#create-user-in-database-connection)
11+
- [Using HTTPS callback URLs](#using-https-callback-urls)
1112
- [Management API (Users)](#management-api-users)
1213
- [Patch user with user_metadata](#patch-user-with-user_metadata)
1314
- [Get full user profile](#get-full-user-profile)
1415
- [Organizations](#organizations)
1516
- [Log in to an organization](#log-in-to-an-organization)
1617
- [Accept user invitations](#accept-user-invitations)
1718
- [Bot Protection](#bot-protection)
18-
- [Domain Switching](#domain-switching)
19+
- [Domain Switching](#domain-switching)
20+
- [Android](#android)
21+
- [iOS](#ios)
22+
- [Expo](#expo)
1923

2024
## Authentication API
2125

@@ -70,7 +74,9 @@ auth0.auth
7074
Custom Schemes can be used for redirecting to the React Native application after web authentication:
7175

7276
```js
73-
authorize({}, { customScheme: 'auth0' }).then(console.log).catch(console.error);
77+
authorize({}, { customScheme: 'YOUR_AUTH0_DOMAIN' })
78+
.then(console.log)
79+
.catch(console.error);
7480
```
7581

7682
### Login using MFA with One Time Password code
@@ -154,6 +160,17 @@ auth0.auth
154160
.catch(console.error);
155161
```
156162

163+
### Using HTTPS callback URLs
164+
165+
HTTPS callback URLs provide enhanced security compared to custom URL schemes. They work with Android App Links and iOS Universal Links to prevent URL scheme hijacking:
166+
167+
```js
168+
auth0.webAuth
169+
.authorize({ scope: 'openid profile email' }, { customScheme: 'https' })
170+
.then((credentials) => console.log(credentials))
171+
.catch((error) => console.log(error));
172+
```
173+
157174
## Management API (Users)
158175

159176
### Patch user with user_metadata

FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,4 @@ If you don't need SSO, consider using `ephemeral sessions` or `SFSafariViewContr
261261

262262
## 9. How can I prevent the autogenerated redirect_uri from breaking if the applicationId has mixed cases or special characters in it on Android ?
263263

264-
It is recommended to have your applicationId in lower case without special characters to prevent any mismatch with the generated redirect_uri. But in the scenario where you require your applicationId to be of mixed case, to avoid any mismatch , the user can pass a `redirectUri` whihc matches the one provided in the manage dashboard as part of the `AgentLoginOptions` property.
264+
It is recommended to have your applicationId in lower case without special characters to prevent any mismatch with the generated redirect_uri. But in the scenario where you require your applicationId to be of mixed case, to avoid any mismatch , the user can pass a `redirectUri` which matches the one provided in the manage dashboard as part of the `AgentLoginOptions` property.

README.md

Lines changed: 95 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ Take note of this value as you'll be requiring it to define the callback URLs be
103103

104104
> For more info please read the [React Native docs](https://facebook.github.io/react-native/docs/linking.html).
105105
106-
> Whenever possible, Auth0 recommends using `https` scheme with [Android App Links](https://auth0.com/docs/applications/enable-android-app-links) as a secure way to link directly to content within your app. Custom URL schemes can be subject to [client impersonation attacks](https://datatracker.ietf.org/doc/html/rfc8252#section-8.6).
107-
108106
##### Skipping the Web Authentication setup
109107

110108
If you don't plan to use Web Authentication, you will notice that the compiler will still prompt you to provide the `manifestPlaceholders` values, since the `RedirectActivity` included in this library will require them, and the Gradle tasks won't be able to run without them.
@@ -213,21 +211,112 @@ Go to the [Auth0 Dashboard](https://manage.auth0.com/#/applications), select you
213211

214212
If in addition you plan to use the log out method, you must also add these URLs to the **Allowed Logout URLs**.
215213

214+
> [!NOTE]
215+
> Whenever possible, Auth0 recommends using [Android App Links](https://developer.android.com/training/app-links) and [Apple Universal Links](https://developer.apple.com/documentation/xcode/allowing-apps-and-websites-to-link-to-your-content) for your callback and logout URLs. Custom URL schemes can be subject to [client impersonation attacks](https://datatracker.ietf.org/doc/html/rfc8252#section-8.6).
216+
>
217+
> 💡 If your Android app is using [product flavors](https://developer.android.com/studio/build/build-variants#product-flavors), you might need to specify different manifest placeholders for each flavor.
218+
216219
#### Android
217220

221+
##### Custom Scheme
222+
223+
```text
224+
{YOUR_APP_PACKAGE_NAME}.auth0://{YOUR_AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback
225+
```
226+
227+
##### App Link (Recommended):
228+
218229
```text
219-
{YOUR_APP_PACKAGE_NAME}.auth0://{AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback
230+
https://{YOUR_AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback
231+
```
232+
233+
> Replace {YOUR_APP_PACKAGE_NAME} and {YOUR_AUTH0_DOMAIN} with your actual application package name and Auth0 domain. Ensure that {YOUR_APP_PACKAGE_NAME} is all lowercase.
234+
235+
To enable App Links, set the `auth0Scheme` to `https` in your `build.gradle` file.
236+
237+
```text
238+
android {
239+
defaultConfig {
240+
manifestPlaceholders = [auth0Domain: "@string/com_auth0_domain", auth0Scheme: "https"]
241+
}
242+
}
220243
```
221244

222-
> Make sure to replace {YOUR_APP_PACKAGE_NAME} and {AUTH0_DOMAIN} with the actual values for your application. The {YOUR_APP_PACKAGE_NAME} value provided should be all lower case.
245+
This configuration ensures that your app uses https for the callback URL scheme, which is required for Android App Links.
246+
247+
#### Enable Android App Links Support
248+
249+
[Android App Links](https://developer.android.com/training/app-links) allow an application to designate itself as the default handler of a given type of link. For example, clicking a URL in an email would open the link in the designated application. This guide will show you how to enable Android App links support for your Auth0-registered application using Auth0's Dashboard.
250+
251+
1. Go to [Auth0 Dashboard > Applications > Applications](https://manage.auth0.com/#/applications), and select the name of the application to view.
252+
253+
2. Scroll to the bottom of the Settings page, and select **Show Advanced Settings**.
254+
3. Select Device Settings, provide the [App Package Name and](https://developer.android.com/studio/build/application-id) the SHA256 fingerprints of your app’s signing certificate for your Android application, and select Save Changes.
255+
![android-app-link](assets/android-app-link.png)
256+
257+
> You can use the following command to generate the fingerprint using the Java keytool in your terminal: `keytool -list -v -keystore my-release-key.keystore`
258+
259+
To learn more about signing certificates, see Android's [Sign Your App](https://developer.android.com/studio/publish/app-signing.html) developer documentation.
223260

224261
#### iOS
225262

263+
##### Custom Scheme
264+
226265
```text
227-
{PRODUCT_BUNDLE_IDENTIFIER}.auth0://{AUTH0_DOMAIN}/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback
266+
{PRODUCT_BUNDLE_IDENTIFIER}.auth0://{YOUR_AUTH0_DOMAIN}/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback
228267
```
229268

230-
> Make sure to replace {PRODUCT_BUNDLE_IDENTIFIER} and {AUTH0_DOMAIN} with the actual values for your application. The {PRODUCT_BUNDLE_IDENTIFIER} value provided should be all lower case.
269+
##### Universal Link (Recommended):
270+
271+
```text
272+
https://{YOUR_AUTH0_DOMAIN}/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback
273+
```
274+
275+
> Replace `{PRODUCT_BUNDLE_IDENTIFIER}` and `{YOUR_AUTH0_DOMAIN}` with your actual product bundle identifier and Auth0 domain. Ensure that {PRODUCT_BUNDLE_IDENTIFIER} is all lowercase.
276+
277+
#### Configure an associated domain for iOS
278+
279+
> [!IMPORTANT]
280+
> This step requires a paid Apple Developer account. It is needed to use Universal Links as callback and logout URLs.
281+
> Skip this step to use a custom URL scheme instead.
282+
283+
##### Configure the Team ID and bundle identifier
284+
285+
Scroll to the end of the settings page of your Auth0 application and open **Advanced Settings > Device Settings**. In the **iOS** section, set **Team ID** to your [Apple Team ID](https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/), and **App ID** to your app's bundle identifier.
286+
287+
![Screenshot of the iOS section inside the Auth0 application settings page](https://github.com/auth0/Auth0.swift/assets/5055789/7eb5f6a2-7cc7-4c70-acf3-633fd72dc506)
288+
289+
This will add your app to your Auth0 tenant's `apple-app-site-association` file.
290+
291+
##### Add the associated domain capability
292+
293+
In Xcode, go to the **Signing and Capabilities** [tab](https://developer.apple.com/documentation/xcode/adding-capabilities-to-your-app#Add-a-capability) of your app's target settings, and press the **+ Capability** button. Then select **Associated Domains**.
294+
295+
![Screenshot of the capabilities library inside Xcode](https://github.com/auth0/Auth0.swift/assets/5055789/3f7b0a70-c36c-46bf-9441-29f98724204a)
296+
297+
Next, add the following [entry](https://developer.apple.com/documentation/xcode/configuring-an-associated-domain#Define-a-service-and-its-associated-domain) under **Associated Domains**:
298+
299+
```text
300+
webcredentials:YOUR_AUTH0_DOMAIN
301+
```
302+
303+
<details>
304+
<summary>Example</summary>
305+
306+
If your Auth0 Domain were `example.us.auth0.com`, then this value would be:
307+
308+
```text
309+
webcredentials:example.us.auth0.com
310+
```
311+
312+
</details>
313+
314+
If you have a [custom domain](https://auth0.com/docs/customize/custom-domains), replace `YOUR_AUTH0_DOMAIN` with your custom domain.
315+
316+
> [!NOTE]
317+
> For the associated domain to work, your app must be signed with your team certificate **even when building for the iOS simulator**. Make sure you are using the Apple Team whose Team ID is configured in the settings page of your Auth0 application.
318+
319+
Refer to the example of [Using custom scheme for web authentication redirection](https://github.com/auth0/react-native-auth0/blob/master/EXAMPLES.md#using-custom-scheme-for-web-authentication-redirection)
231320

232321
## Next Steps
233322

assets/android-app-link.png

41.2 KB
Loading

docs/assets/hierarchy.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
window.hierarchyData =
2+
'eJyNj8FqwzAQRP9lzkrqCMs2uiWlh57bW/BB2BssIktFWkNL8L8XN9i4pSE5LezO8N5eEEPgBH3MKyVkUdYCkU6OGrbBJ+gLZKam4U1P0Hi3PYWBX2IMEQJn61vonawEhuig0TiTEqWndW7bce8grjdocGo3U3FzXYwCsihXjINJdB/w9UFpu0TvMASazro2koc+ykzVE7TMV9D9wF32HDzTJ796pngyDS0CUhWzgJ2Ps8O/zZs+S336O6/UH4U3Nvw49if9AOr3+2Vej+P4Dc50qC0=';

0 commit comments

Comments
 (0)