Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
Using Apple Sign in, why is apple auth not redirecting after authenticating (when using face id)?

I am sending a user to the apple authentication site where they fill in their apple login information on a form:

const signInWithApple = () => {
  const params = {
    client_id: Config.APPLE_AUTH_CLIENT_ID,
    redirect_uri: 'https://www.example-site.com/auth/apple/',
    scope: 'name email',
    response_type: 'code',
    response_mode: 'form_post',
  };

  const loginUrl = `https://appleid.apple.com/auth/authorize?${queryString.stringify(params)}`;
  window.open(loginUrl, '_blank', `scrollbars=yes, width=520, height=570`);
};

After it has authenticated the user, it redirects the user to the URL that is defined in the redirect_uri property. Then I verify the token and log in the user on my end. That works beautifully.

The problem occurs when, instead of opening the window with the form fields, it opens a sheet at the bottom of the Safari mobile browser to allow the user to use face id. If you follow through with that, it looks like it recognizes your face and closes the sheet but it never redirects the user to my URL page where I log in the user after verifying their token.

Has anybody encountered this? I would love some ideas on how to solve this please!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Finally, I use apple auth js sdk to solve this problem, just for safari🥲

Document is here:

https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/configuring_your_webpage_for_sign_in_with_apple

// add this script to your website
<script src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/zh_CN/appleid.auth.js"></script>
// or en_US
<script src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"></script>

// init sdk
window.AppleID.auth.init({
  clientId: YOUR_APPLE_CLIENT_ID,
  scope: 'name email',
  redirectURI: redirectUrl,
  state: state,
  nonce: String(Date.now()),
  usePopup: true,
})

// get auth
const {
      authorization: { code, id_token, state },
      user,
  } = await window.AppleID.auth.signIn()
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!