apple-client-secret-generator
v1.0.3
Published
This package solves the problem of generating a JWT secret key for an Apple id, which is used for authorization through an apple id.
Downloads
46
Maintainers
Readme
apple-client-secret-generator
This package solves the problem of generating a JWT secret key for an Apple id, which is used for authorization through an apple id.
The implementation is based on Apple's Generate and Validate Tokens documentation.
Installation
npm i apple-client-secret-generator
Usage
The value expiresIn must not be greater than 15777000 (6 months in seconds) from the Current UNIX Time on the server.
const { createClientSecret } = require('./index');
const fs = require('fs');
const config = {
keyId: '',
clientId: '',
teamId: '',
privateKey: fs.readFileSync('../../AuthKey_TEST323.p8', 'utf8'),
expiresIn: 86400*180,
};
const clientSecret = createClientSecret(config);`