Skip to content

Danil27/apple-client-secret-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://www.npmjs.com/package/apple-client-secret-generator

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);`

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published