capacitor-community / apple-sign-in

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

Apple Sign in on web in localhost #86

Open mattwyld-north27 opened 1 year ago

mattwyld-north27 commented 1 year ago

Describe the bug I have this working on an iOS device fine but when attempting to use apple log in while developing on http://localhost:8100 it just tells me that i have an "invalid_request - Invalid web redirect url."

What am I doing work?

const options: SignInWithAppleOptions = {
  clientId: 'com.myapp',
  redirectURI: 'http://localhost:8100/login',
  scopes: 'email name',
  // state: '1256',
  state: '12345',
  nonce: hashedNonceHex,
};
const appleUser: SignInWithAppleResponse = await SignInWithApple.authorize(options);`

image

msoler95 commented 1 year ago

I worked for me when I changed the clientId for the serviceId. Go to here and create a service. Then add the service identifier to your options.clientId

alexcroox commented 1 year ago

Apple login doesn’t work with http. Even localhost

LeCoupa commented 6 months ago

Yes that's what the docs says.

Provide your web domain and return URLs that will support Sign in with Apple. Your website must support TLS 1.2 or higher. All Return URLs must be registered with the https:// protocol included in the URI string. After registering new website URLs, confirm the list you’d like to add to this Services ID and click Done. To complete the process, click Continue, then click Save.