Closed AlmutawakelSukaina closed 2 months ago
When attempting to use Sign in with Apple on my Flutter web app, I encounter the following error message:
Your request could not be completed because of an error. Please try again later.
The issue only occurs on the web platform. The implementation works as expected on Android and iOS devices.
<!DOCTYPE html> <html lang="en"> <head> <base href="/"> <meta charset="UTF-8"> <meta content="IE=Edge" http-equiv="X-UA-Compatible"> <!-- iOS meta tags & icons --> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-title" content="Azer"> <link rel="apple-touch-icon" href="icons/Icon-192.png"> <!-- Icons and Favicons --> <link rel="icon" type="image/png" href="favicon.png"/> <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"> <!-- Manifest --> <link rel="manifest" href="manifest.json"> <!-- Preconnect and DNS Prefetch for External Resources --> <link rel="preconnect" href="https://appleid.cdn-apple.com" crossorigin> <link rel="dns-prefetch" href="https://appleid.cdn-apple.com"> <!-- Apple sign-in script --> <script type="text/javascript" src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js" defer></script> </head> <body> <!-- Load the Flutter Bootstrap script --> <script src="./flutter_bootstrap.js" async></script> </body> </html>
final credential = await SignInWithApple.getAppleIDCredential( scopes: [ AppleIDAuthorizationScopes.email, AppleIDAuthorizationScopes.fullName, ], webAuthenticationOptions: WebAuthenticationOptions( clientId: 'serviceId', redirectUri: Uri.parse('my url'), ), );
Users should be able to successfully sign in with Apple on the web, just as they can on Android and iOS devices.
An error is returned on web:
The issue has been resolved by adjusting the redirect URI settings:
For web, the redirect URI needs to be the host of the current page.
Description:
When attempting to use Sign in with Apple on my Flutter web app, I encounter the following error message:
The issue only occurs on the web platform. The implementation works as expected on Android and iOS devices.
Build Information:
Index.html Setup:
Dart Code for Sign in with Apple:
Steps to Reproduce:
Expected Behavior:
Users should be able to successfully sign in with Apple on the web, just as they can on Android and iOS devices.
Actual Behavior:
An error is returned on web:
Additional Information: