Hello! This is my first time posting so please forgive me for any guidelines I may be overlooking. Basically I’m new to IOS development and Auth0 and I recently set up my SwiftUI app with Auth0 and submitted it to the app store. I was rejected because I didn’t support Apple sign-in, so I followed the Auth0 tutorial for supporting Apple sign-in and I’m running into a bit of a paradox. Here’s the issue:
In order to set up apple sign in I need to give a return URL to my serviceID in the apple developer console, this return URL must use https
In order to use Auth0 I need to give a return URL to my Auth0 app that follows this format: YOUR_BUNDLE_IDENTIFIER://YOUR_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback. Notice that there is no https.
The return URLs are supposed to be exactly the same for Auth0 and in the Apple Developer Console.
So I guess that means I should update my normal Auth0 callback URLs to use https? How should I go about doing this? I feel like I could be misunderstanding something because it seems odd that the Auth0 SwiftUI tutorial would have me set a callback URL that in practice can’t be used with SwiftUI apps.
If anyone has experienced a similar issue or has any advice please let me know. Thank you!!
When setting up Apple Sign-In with Auth0 in your SwiftUI app, you may encounter a conflict between the required return URL formats for both Auth0 and Apple Developer Console. To resolve this issue, you can follow these steps:
Update the callback URL in your Auth0 application settings to use the https protocol. You can do this by going to the Auth0 Dashboard, selecting your application, navigating to the “Application” tab, and updating the “Allowed Callback URLs” field. Ensure that the callback URL follows the format: https://YOUR_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback.
In your Apple Developer Console, when configuring your serviceID for Apple Sign-In, provide a return URL that uses a custom URL scheme instead of the https protocol. For example, you could use: YOUR_BUNDLE_IDENTIFIER://YOUR_DOMAIN/ios/YOUR_BUNDLE_IDENTIFIER/callback.
In your SwiftUI app’s AppDelegate, implement the application(_:open:options:) method to handle the custom URL scheme callback. Extract the callback URL and pass it to the Auth0 SDK for processing. You can refer to the Auth0 documentation or sample code for the specific implementation details.
By using a custom URL scheme for Apple Sign-In and an https URL for Auth0 callback, you can satisfy the requirements of both systems. This approach allows your SwiftUI app to support Apple Sign-In while also integrating with Auth0 for authentication.
Make sure to thoroughly test your app to ensure that the callback flow works correctly for both Apple Sign-In and Auth0 authentication.