Auth0 Error Occurs When Using exchangeNativeSocial With Native Apple Sign In
Last Updated:
Overview
An error occurs when using exchangeNativeSocial with Apple because the nonceEnabled parameter defaults to true. Disable nonce verification in the React Native application code that performs the Apple authentication request to resolve the error. When attempting a Native Apple Sign In via exchangeNativeSocial, the authentication fails silently. The web flow functions correctly, but the native flow generates the following error message:
invalid_request: Error from apple connection (no description)
Applies To
- Auth0
- Native Apple Sign In
- @invertase/react-native-apple-authentication package
Cause
During a Native Flow via exchangeNativeSocial, the React Native application initiates the request and requests the authorization code from iOS directly using the third-party @invertase/react-native-apple-authentication package. Because Auth0 does not initiate this request, Auth0 lacks context about the security parameters used. If the nonceEnabled parameter defaults to true in the Apple authentication package and the parameters do not match perfectly, Apple silently rejects the Auth0 validation attempt. This rejection results in the empty error response.
Solution
How is the Apple connection error resolved?
Locate the Apple authentication implementation in the React Native code using the @invertase/react-native-apple-authentication package and update the authentication request function to disable nonce verification.
-
Open the React Native application code and locate the Apple authentication implementation.
-
Find the
appleAuth.performRequest()function call from the@invertase/react-native-apple-authenticationpackage used to request the authorization code from iOS. -
Pass the
nonceEnabledparameter set tofalseinside the configuration object of this function to disable nonce verification.