scottrhoyt / apple-music-jwt Goto Github PK
View Code? Open in Web Editor NEWA library for creating JWTs for accessing the Apple Music API.
License: MIT License
A library for creating JWTs for accessing the Apple Music API.
License: MIT License
Need to set jwt expire time to 182d
(days) or 15724800
I ran npm install apple-music-jwt
and put the following in an index.js file (keys redacted):
var keyID = 'music.com.mydomain.myproject';
var teamID = 'VWxxxxxxxx';
var secret = 'MIGT... '; // from AuthKey_<some value>.p8 file
When I run node index.js
, I get the the following error:
Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
at Sign.sign (internal/crypto/sig.js:85:26)
at sign (/Users/petrus/Projects/apple-music-jwt/node_modules/jwa/index.js:55:45)
at Object.sign (/Users/petrus/Projects/apple-music-jwt/node_modules/jwa/index.js:75:27)
at Object.jwsSign [as sign] (/Users/petrus/Projects/apple-music-jwt/node_modules/jws/lib/sign-stream.js:23:24)
at Object.module.exports [as sign] (/Users/petrus/Projects/apple-music-jwt/node_modules/jsonwebtoken/sign.js:189:16)
at Object.module.exports.generate (/Users/petrus/Projects/apple-music-jwt/node_modules/apple-music-jwt/src/index.js:24:14)
at Object.<anonymous> (/Users/petrus/Projects/apple-music-jwt/index.js:7:17)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
What am I doing wrong? This JWT stuff is so hard.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.