Apple Sign In JavaScript usePopup from multiple URLs

I am using Apple Sign In with JavaScript in usePopup mode. This is working fine but in order for the popup to return data to the parent window the URL of the parent window must match one of the redirect URIs configured for the services ID. The redirect URI also needs to be sent back Apple to validate the token and again it must match one of those configured.

The problem I have with this is that my page can have multiple URLs because the URLs are structured as follows:

https:// client-subdomain.mysite.com/optional-lang-code/slug-in-language

These are all valid examples:

https:// client1.mysite.com/sign-in
https:// client1.mysite.com/en-gb/sign-in
https:// client1.mysite.com/einloggen
https:// client1.mysite.com/de-de/einloggen
https:// client2.mysite.com/registrarse
https:// client2.mysite.com/es-es/registrarse
https:// client2.mysite.com/se-connecter
https:// client2.mysite.com/fr-fr/se-connecter

As you can there is the potential for there to be a lot of URLs and it quickly becomes a nightmare to manage in the Apple Developer Console, and there is not API to help automate this.

Is there any way around this? Could I use wildcards when adding the redirect URIs in the Apple developer console in order to cover multiple paths whilst still validating against the domain part of the URL. It would be so much friendlier to developers if this were possible. It seems strange the the redirect URI gets used at all in this flow because the redirect does not even occur.

I have Google sign in on the same site and this works without a problem. It uses a popup in the same way but does not enforce that the popup must come from a particular URL, it is enough that it comes from a particular domain. Therefore the setup in the Google developer console is much easier and can be done once and then forgotten about even if new languages are added in future.

https://developer.apple.com/forums/thread/128788?page=2 https://developer.apple.com/forums/thread/699970

Do the posts help this issue ?

For example if the app that invoked Sign in with Apple JS has url "https://www.example.com/test" then the redirectURI should be "https://www.example.com"

Apple Sign In JavaScript usePopup from multiple URLs
 
 
Q