-
I am trying to understand how Relays are working by writing one in Java. I want to post an Accept activity from a Java client to a Mastodon inbox. As of today, I am receiving a 401 message with I do not understand the sequence though:
The Signature header value being used is: At this point in time, the connection is rejected. I am not able to send the Json payload so the server had no way to compute the digest of the payload. If I compute the digest based on an empty string, the error does not appear anymore (but this hardly makes sense, does it?). As far as I understand I've followed all steps that are required for HTTP signatures (although the documentation does not mention the need for a digest as also mentioned here.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Mastodon requires all actors to implement the WebFinger protocol, including relay actors. I'm not sure if you edited that part out of your question intentionally, but the .well-known/webfinger route (or the host-meta route, optionally) is required. I couldn't speak to the HTTP signatures issues you're having, but it sounds like maybe an issue with the |
Beta Was this translation helpful? Give feedback.
Mastodon requires all actors to implement the WebFinger protocol, including relay actors. I'm not sure if you edited that part out of your question intentionally, but the .well-known/webfinger route (or the host-meta route, optionally) is required.
I couldn't speak to the HTTP signatures issues you're having, but it sounds like maybe an issue with the
body
you're sending in your request. If the body of your request is empty, then obviously the digest value will have to be empty as well. Maybe that's a place to start your debugging? I would also suggest looking up examples for how to send POST bodies with the Java libraries you're using for other tips and tricks.