ananay / apple-auth

Sign in with Apple for Node.js
326 stars 59 forks source link

Help - Always getting 'invalid_client' #26

Closed mylogon341 closed 3 years ago

mylogon341 commented 3 years ago

I followed the guide accurately, but I always get this

image

The only thing in the console in chrome is

app.js:231 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ". Either the 'unsafe-inline' keyword, a hash ('sha256-6wRdeNJzEHNIsDAMAdKbdVLWIqu8b6+Bs+xVNZqplQw='), or a nonce ('nonce-...') is required to enable inline execution.

I don't know if that's related, but I'm totally stuck with this. Can anyone help? Thanks a lot.

ananay commented 3 years ago

Hi @mylogon341,

The chrome error is unrelated to the problem, that's just on Apple's website and doesn't affect the functioning of the Sign in with Apple feature.

As for invalid client, please make sure you've followed the guide exactly – word for word – because the steps are very important. I know it's kind of a lot to follow but it is what is.

Please make sure you're using the correct Service ID in the client id section as I've specified in the guide: The client_id is actually called the "Service ID" that you will create in the 'Identifiers' section

https://github.com/ananay/apple-auth/blob/master/SETUP.md

Once again, here's the guide.

All the best!

mylogon341 commented 3 years ago

I found the issue to be that apple have a new way to register domains via their siwa email system - that domain needs to be setup to satisfy the SPF check. That domain needs to be the one that is used in the configuration of the Services ID.

ananay commented 3 years ago

@mylogon341 Thank you so much the tip! If you could document that in https://github.com/ananay/apple-auth/blob/master/SETUP.md that'd be great, or I can do it later!