I’m trying to setup Sign In With Apple. I’ve gone through the process on the apple side and generated the necessary info. I followed the guide here: https://auth0.com/docs/connections/apple-setup
I’m trying to add it to the Auth0 Apple config screen (social setup), but when I try to save the screen with the “Client Secret Signing Key” entered I receive an error “Error! options.app_secret must be in PEM format”. I used the provided node script to generate the key, and I’ve tried wrapping the result in things like -----BEGIN CERTIFICATE----- and -----BEGIN PRIVATE KEY----- but I get the same error.
I would appreciate any suggestions. Script below. Thanks
const jwt = require(“jsonwebtoken”);
const fs = require(“fs”);
const privateKey = fs.readFileSync(“…/keys/AuthKey_signInWithApple.p8”);
const token = jwt.sign({}, privateKey, {
algorithm: “ES256”,
expiresIn: “60 days”,
audience: “https://appleid.apple.com”,
issuer: “YGF36*****”,
subject: “com.myurl.webapp”,
keyid: “BJR79*****”
});
console.log(“The token is:”, token);