ActivityPub: no user-agent sent with request Failure while creating client

Hey there,

I’m experiencing issues when trying to communicate with some Mastodon instances.

Seems that many admins have a config requirement to only interact with apps/servers that provide user-agent, which I can see the activitypub plugin is not providing.

Do you think you could add a user-agent like this to future versions requests?

‘Discourse-ActivityPub/x.y.z (+https://eg-discourse-domain.com)’ or similar?

This will fix both federation and the ability to link profiles to mastodon instances that have this requirement.

Thank you for your time reviewing this.



Discuss this on our forum.
1 Like

This is a reasonable feature request. I gave it a shot in this PR: https://github.com/discourse/discourse-activity-pub/pull/268



Discuss this on our forum.

@pmusaraj Federation is working as expected! Thank you!

Now I’m still seeing the same error when trying to vinculate an actor to my discourse profile, complaing that the user-agent is null (from the instance logs) and failing to create client.

The link for my profile is like:

https://example.com/u/ayr-ton/preferences/activity-pub



Discuss this on our forum.

Can you share a screenshot of the instance log with the error?



Discuss this on our forum.

For testing, you can try linking your profile to ayr-ton.net or alquimidia.social.br and you will see the same errors. If the login appears the user-agent is being sent through the profile configuration as well.



Discuss this on our forum.
1 Like

Thanks, it should be addressed once this gets merged:

https://github.com/discourse/discourse-activity-pub/pull/269



Discuss this on our forum.

Amazing, the user-agent is fixed!

Only error I’m seeing now (gotososocial instances, mastodon ones are working as expected in all scenarios):

invalid_request Bad Request: redirect_uri was not set in the token request form

Do you think this is a good first PR for me?



Discuss this on our forum.
1 Like

Sure, please do submit a PR, thanks!



Discuss this on our forum.