Skip to content

feat(add): Add Apple Secret generation#10

Merged
balazsorban44 merged 17 commits intonextauthjs:mainfrom
serhiyhvala:feat/apple-gen-secret
Oct 7, 2024
Merged

feat(add): Add Apple Secret generation#10
balazsorban44 merged 17 commits intonextauthjs:mainfrom
serhiyhvala:feat/apple-gen-secret

Conversation

@serhiyhvala
Copy link
Copy Markdown
Contributor

@serhiyhvala serhiyhvala commented Jul 18, 2024

Generate client_secret for Apple Provider

ℹ️ More Details

Link to thread in X

Apple Client secrets are special ✨

They require the developer to collect the following values from the Apple Developer dashboard:

  • Team ID (pasted from clipboard)
  • Key ID (pasted from clipboard)
  • Client ID (pasted from clipboard)
  • Private Key (the developer needs to provide a path to the .p8 file.)

Then, a JWT is constructed with an optional expiration date (180 days from now by default) which will be then saved as AUTH_APPLE_SECRET.

More details: https://developer.apple.com/documentation/accountorganizationaldatasharing/creating-a-client-secret

🧢 Checklist

  • Documentation
  • Ready to be merged

📌 Resources

@balazsorban44 balazsorban44 changed the title feat/apple-gen-secret feat(add): Add Apple Secret generation Oct 7, 2024
@balazsorban44
Copy link
Copy Markdown
Member

Thank you! Sorry that it took this long. 🙈

@balazsorban44 balazsorban44 merged commit 04e7dc1 into nextauthjs:main Oct 7, 2024
@hanzalaansari
Copy link
Copy Markdown

so now we do not need to genrate the secret from here https://generate-client-secret.vercel.app/
will it gen automatically
AppleProvider({
clientId: process.env.APPLE_CLIENT_ID,
clientSecret: {
teamId: process.env.APPLE_TEAM_ID,
privateKey: process.env.APPLE_PRIVATE_KEY?.replace(/\n/g, "\n"),
keyId: process.env.APPLE_KEY_ID,
},
}),
],
@balazsorban44

@hanzalaansari
Copy link
Copy Markdown

@balazsorban44 getting 500 Internal Server Error.

@balazsorban44
Copy link
Copy Markdown
Member

balazsorban44 commented Oct 14, 2024

hi, no. you still need to generate the secret at build time, given the variables Apple requires.

But instead of going to the website, you can add generate it via npx auth add apple which will also add it in your env file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants