Apple authentificaiton
Hey i'm kinda new to better auth and i did create pretty easily auth with credentials and google, i have a apple developper license and i'm looking to create an authentication but i'm stuck :
i'm using nextjs on this app :
i created the app id xx.xx.appname with Sign In with Apple but no setup
i also did the service xx.xx.appname.client with domain : domain.net and return url : https://domain.net/api/auth/callback/apple
and i'm stuck here at the keys part and the setup in the .env :
i created a key with Sign in with Apple the right app id and i downloaded the .p8
how do i create the jwt, do i create a script on the server or and is the jwt the client secret like we say in the documentation ?
but i don't know what to do now what is the APPLE_CLIENT_ID and the APPLE_CLIENT_SECRET for the .env
Solution:Jump to solution
you will need to generate the apple client secret yourself, you can set up a script to do just that eg ```typescript
const jwt = require("jsonwebtoken");
// Create JWT...
4 Replies
Solution
you will need to generate the apple client secret yourself, you can set up a script to do just that eg
privateKey is the p8 file's contents and token is your apple client secret
thank you very much
i did everything put the APPLE_CLIENT_ID and APPLE_CLIENT_SECRET
i did the script with
APPLE_KEY_ID
APPLE_PRIVATE_KEY
APPLE_TEAM_ID
APPLE_CLIENT_ID
that i'm not gonna share for obvious reasons but i still got

ok i stfu i find why in the service i did not put the Domains and Subdomains
ok no i don't understand
should i put
xx.company.project
xx.company
xx.company.project.client
as apple client id
on the .env