Connecting Ghost and GToolkit
As GToolkit is my integrated development environment, I want to be able to quickly post articles on my Ghost instance. Ghost has a REST API, so that should be straight forward. Let's see how we do.
client := ZnClient new.
client url: 'https://{admin_domain}/ghost/api/admin/{resource}.
client get.

That means I need to go to settings, advanced, integrations and add a custom integration.

When I add an integration, I get a public and a secret key added together with a colon as admin_api. I need to split them, as Ghost wants the public key added as kid field to the JWT token header.

Getting JWT tokens to work is always annoying, as there are so many tiny things that can go wrong and the error messages are always useless. The public key can be added directly, but the signing needs to happen with the string converted from a hex string. The timestamps for issuing and expiration time need to be in unix time format.

Ghost expects the public key kid field in the header, which was not supported in the JWT implementation but trivial to add.

The authorization is then set as
client request setAuthorization: 'Ghost ',tokenString.

And of course, don't forget to regenerate keys after making screenshots showing them