-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project Status? #4
Comments
Hi, |
Facing the same issue! |
related - ananay/apple-auth#18 I haven't seen the code in this repo - BROKEN. hard coding to let key = res.data.keys[0] // fails 1 in 7 goes. const getApplePublicKey = async () => {
let res = await axios.request({
method: "GET",
url: "https://appleid.apple.com/auth/keys",
})
let key = res.data.keys[0]
const pubKey = new NodeRSA();
pubKey.importKey({ n: Buffer.from(key.n, 'base64'), e: Buffer.from(key.e, 'base64') }, 'components-public');
console.log('apple公钥')
console.log(pubKey.exportKey(['public']))
return pubKey.exportKey(['public']);
};
FIXED const getAppleIDPublicKey = async (kid) => {
let res = await axios.request({
method: "GET",
url: "https://appleid.apple.com/auth/keys",
})
// console.log("res:",res)
const keys = res.data.keys;
const key = keys.find(k => k.kid === kid);
const pubKey = new NodeRSA();
pubKey.importKey({ n: Buffer.from(key.n, 'base64'), e: Buffer.from(key.e, 'base64') }, 'components-public');
return pubKey.exportKey(['public']);
}; |
Hi there, just curious if this is still being maintained? The example site and such seem to be dead with a long period since the last commit.
The text was updated successfully, but these errors were encountered: