Issues with Shared Apple Sign In Across Multiple Swift Apps with Realm

I’m currently facing problems with implementing a shared authentication flow between two Swift apps using Sign in with Apple and Realm for user authentication and data sync.

Here’s the situation:

  • I have successfully implemented Apple Sign In for a Swift app. This app authenticates a user with an app service to sync data between clients, and everything works as expected.
  • My goal now is to connect a second app to the same app service using Apple Sign In, intending to log in as the same user as the first app. This way, both clients can sync the same user data.

To set this up correctly, I have:

  • Added the Sign in with Apple capability to the second app.
  • Grouped both apps for Sign in with Apple the the Apple Developer Console, with the first app set as the primary App ID.

However, I’m encountering a login failure with the server error: “invalid id token: ‘aud’ must be a string containing the client_id”.

My question now: Is it possible, using the Realm Swift SDK, to authenticate the same user across different Swift apps via Sign in with Apple ? If so, are there specific configurations or steps that I might be missing?

Thank you in advance for your help!

1 Like