Post not yet marked as solved
Post marked as unsolved with 4 replies, 2,520 views
I want to use Apple Music using MusicKit.
I've created MusicKit identifier and private key by following all the steps mentioned here: https://help.apple.com/developer-account/#/devce5522674
I have my Team ID, the Music key ID and the private key (.p8 file) with me.
I tried to generate the required JWT token by using many scripts that were mentioned in similar questions asked here, but none of them have worked so far. When I try to authenticate, I'm getting an error ERROR_FAILED_TO_VERIFY_JWT.
Ref: Codes I've tried to generate the JWT token from: Thread 130168 - https://developer.apple.com/forums/thread/130168
A nice and simple blog by Lee Martin [Blog - Creating an Apple Music API Token]
Thread 79074 - https://developer.apple.com/forums/thread/79074
Many other links
But sadly, none of them worked and I had to post this question.
I have tried the sample Android app: https://developer.apple.com/download/more/?=Android%20MusicKit
After authentication, the page goes on with an infinite loader, which I believe must be because of the same error ERROR_FAILED_TO_VERIFY_JWT
Also tried with this HTML page:
<html>
<head>
<meta name="apple-music-developer-token" content="the-JWT-token-generated-using-the-reference-links">
<meta name="apple-music-app-name" content="My App Name">
<meta name="apple-music-app-build" content="1978.4.1">
</head>
<body>
<button id="apple-music-authorize"></button>
<button id="apple-music-unauthorize"></button>
</body>
<script src="link-to-musickit.js"></script>
<script>
let music = MusicKit.getInstance();
		music.player.play();
		music.authorize().then(function() {
				music.player.play();
		});
		music.authorize().then(function() {
				 music.api.library.albums.then(function(cloudAlbums) {
							// user's cloudAlbums
				});
		});
</script>
</html>