Posts

Post not yet marked as solved
22 Replies
13k Views
I am trying to access API of Apple Music API > https://developer.apple.com/documentation/applemusicapiAfter creating the JWT developer token, when i try to access the API, An error of 401 - Unauthorized occurs. I am doing it in the following way : 1) Registering a new music identifier > https://help.apple.com/developer-account/#/devce5522674?sub=dev0416b90042) Creating a MusicKit identifier and private key > https://help.apple.com/developer-account/#/devce5522674 also downloading the private key file. 3) Getting the Kid (Key Id) and issuer (Team Id) . 4) Running the following code to generate the token : const jwt = require("jsonwebtoken"); const privateKey = fs.readFileSync("AuthKey_KEY_ID.p8").toString(); const teamId = TEAM_ID_HERE; const keyId = KEY_ID_HERE; const jwtToken = jwt.sign({}, privateKey, { algorithm: "ES256", expiresIn: "120d", issuer: teamId, header: { alg: "ES256", kid: keyId } }); console.log(jwtToken);And after that checking the code using the curl command : curl -v -H 'Authorization: Bearer [developer token]' "https://api.music.apple.com/v1/catalog/us/songs/203709340" I am not sure what i am missing here. is it something related to access or is it my code.P.S : I am the Account Holder, so it is not an issue related to role. Thanks
Posted
by akh123.
Last updated
.
Post not yet marked as solved
2 Replies
1.3k Views
We're using https://developer.apple.com/documentation/musickitjs to authorize Apple music, on Desktop it opens a new window to authorize to apple. But It's NOT working on mobile (both iOS & Android), probably because on mobile messenger it's not possible to allow opening of multiple windows. Are we missing something here? Any workaround for it ?Anyone done that ?
Posted
by akh123.
Last updated
.