next.js - What's the trick for Apple Sign In Auth on WebApp? Results in error - Stack Overflow

Based on the Supabase docs, & Configuration tool, I have setup the following to allow for Apple Sig

Based on the Supabase docs, & Configuration tool, I have setup the following to allow for Apple Sign In on web app:

  • Account ID: 10 Characters
  • Service ID: com.my.webapp.service - setup to allow for Apple Sign onFirst created new App ID:
    • First Created my appID: com.my.webapp, added domain & SupaBase callback URL
  • Generated Service KeyID: 10 Characters, and downloaded the P8 key file
  • Entered this into the Credential Generator tool on the link above.
  • Pasted that into the dashboard/**/auth/providers section
  • Pasted the Service ID from item above into Client ID of dashboard
  async function signInWithApple() {
    setIsLoading(true);
    try {
      const { error } = await supabase.auth.signInWithOAuth({
        provider: 'apple',
        options: {
          redirectTo: `${window.location.origin}/auth/callback`,
        },
      });
      if (error) {
        throw error;
      }
    } catch (error) {
      console.error(error);
      toaster.create({
        title: 'Please try again.',
        description: 'There was an error logging in with Apple.',
        type: 'error',
      });
    } finally {
      setIsLoading(false);
    }
  }

When I try to use this on my web app, it results in error:

invalid_request
Invalid client id or web redirect url.

What am I doing wrong?

Or is this an issue with localhost urls in dev?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745239789a4618112.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信