capacitor-community / apple-sign-in

Sign in with Apple Support
MIT License
135 stars 58 forks source link

clientId not set? #99

Open kennardconsulting opened 10 months ago

kennardconsulting commented 10 months ago

First, thanks for this great plugin! I am using it on both Web and iOS.

Everything works great on Web. It almost works on iOS, but the error I get when trying to make use of the returned identityToken is "client_id mismatch. The code was not issued to xxx.xxx"

Debugging inside Plugin.swift, I can see that the call object has call.options["clientId"] set correctly to my app's client_id. However I cannot see anywhere that Plugin.swift makes use of this value? It doesn't seem to set it on the request that gets sent to Apple?

kennardconsulting commented 10 months ago

Possibly I'm mistaken and a native app will always just send its own appId as the clientId, with no ability to override this in the Apple authentication API? So clientId is only relevant for Web?

kennardconsulting commented 10 months ago

Confirmed. It's working if I use my native appId when making use of the returned identityToken. However, it would be nice if there was a way to override clientId so that my Web UI and native UI are sending identityTokens generated using the same clientId (that way my back-end doesn't have to differentiate).