nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
25.08k stars 3.55k forks source link

fix(providers): conform Apple #12068

Closed balazsorban44 closed 1 month ago

balazsorban44 commented 1 month ago

☕️ Reasoning

"Sign in with Apple" is not the smoothest thing to implement. The DX for setting things up for development is subpar considering the UX they uphold themselves for their users. It requires extra hops on every corner.

But here it is. With some hacks in the core library - since Apple is unable to follow the OIDC spec -, it is now fully working again. I'm sorry for those who needed to implement hacks for it before.

As part of this work, we've also worked on a way to generate the client secret with a community member, since Apple expects it to be a JWT. You can run npx auth add apple in the root of your project, and it will give you a step-by-step on how to do it. At the end, it will add the AUTH_APPLE_ID and AUTH_APPLE_SECRET to your env file as well.

Feedback on it is appreciated!

Huge thanks to @ChrGrb for the preliminary work in #8428 and #8189.

🧢 Checklist

🎫 Affected issues

Closes #8189 Closes #6788 Closes #4061 Closes #8188 Closes #9989

📌 Resources

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 19, 2024 7:34pm
2 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **next-auth-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/authjs/next-auth-docs/2bgwiTGyPpCRwNxxGNstykpc4Zdb)) | | | Oct 19, 2024 7:34pm | | **proxy** | ⬜️ Ignored ([Inspect](https://vercel.com/authjs/proxy/i7cbjtnFi1Ht6M1Do7UKKJ4CVvAc)) | | | Oct 19, 2024 7:34pm |
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 8.57143% with 96 lines in your changes missing coverage. Please review.

Project coverage is 39.21%. Comparing base (cce41cf) to head (23c5c97). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
packages/core/src/providers/apple.ts 0.00% 70 Missing :warning:
...s/core/src/lib/actions/signin/authorization-url.ts 0.00% 11 Missing :warning:
...es/core/src/lib/actions/callback/oauth/callback.ts 0.00% 9 Missing :warning:
packages/core/src/providers/oauth.ts 0.00% 4 Missing :warning:
packages/core/src/lib/utils/providers.ts 81.81% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #12068 +/- ## ========================================== - Coverage 39.27% 39.21% -0.06% ========================================== Files 191 191 Lines 29852 29920 +68 Branches 1288 1297 +9 ========================================== + Hits 11725 11734 +9 - Misses 18127 18186 +59 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

plowden commented 1 month ago

Authjs (next-auth) 5.0.0-beta.25 worked for me for Apple login today, even after upgrading to Next 15.0/React 19.0. Many thanks for your efforts on this.