Verify the Apple id token on the server side.
idToken
to the backend which will verify itnpm install verify-apple-id-token
import verifyAppleToken from "verify-apple-id-token";
const jwtClaims = await verifyAppleToken({
idToken: "yourIdToken",
clientId: "yourAppleClientId", // or ["app1ClientId", "app2ClientId"]
nonce: "nonce", // optional
});
jwtClaims.email; // get email of the user
const verifyAppleToken = require("verify-apple-id-token").default;
const jwtClaims = await verifyAppleToken({
idToken: "yourIdToken",
clientId: "yourAppleClientId", // or ["app1ClientId", "app2ClientId"]
nonce: "nonce", // optional
});
Thank you for your interest in contributing to verify-apple-id-token
! Please see the CONTRIBUTING.md to learn how to do it!