snarfed / bridgy

📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
https://brid.gy
Creative Commons Zero v1.0 Universal
710 stars 52 forks source link

[bug] compatability issues with GoToSocial #1385

Closed jk-na closed 1 year ago

jk-na commented 1 year ago

What happened?

  1. Navigate brid.gy to the mastodon login path
  2. Enter my gts server and then log in with my gts account
  3. Approve the oath request: Application Bridgy (https://brid.gy/) would like to perform actions on your behalf, with scope read:accounts read:blocks read:notifications read:search read:statuses.

    The application will redirect to https://brid.gy/mastodon/callback to continue.

    1. Error returned on redirected page.

What you expected to happen?

To be able to authenticate with brid.gy in order to enable the application to interact with my GtS account

How to reproduce it?

Same steps as above

Anything else we need to know?

The errors from the syslog on the gts server:

Jan 11 12:49:57 gtsRock gotosocial[1024]: timestamp="11/01/2023 12:49:57.143" func=oauth.New.func1 level=ERROR msg="internal oauth error: parse \"https://brid.gy/mastodon/callback\\nhttps://brid.gy/delete/finish\\nhttps://brid.gy/micropub-token/mastodon/finish\\nhttps://brid.gy/publish/mastodon/finish\\nhttps://brid.gy/mastodon/delete/finish\": net/url: invalid control character in URL"
Jan 11 12:49:57 gtsRock gotosocial[1024]: timestamp="11/01/2023 12:49:57.143" func=oauth.New.func2 level=ERROR msg="internal response error: server_error"
Jan 11 12:49:57 gtsRock gotosocial[1024]: timestamp="11/01/2023 12:49:57.148" func=router.loggingMiddleware.func1 level=INFO latency=20.272862ms clientIP=192.168.1.1 userAgent="Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0" method=POST statusCode=302 path=/oauth/authorize msg="Found: wrote 23B"

The url of the callback: https://brid.gy/mastodon/callback?error=server_error&error_description=The+authorization+server+encountered+an+unexpected+condition+that+prevented+it+from+fulfilling+the+request&state=11

Text on the resulting html page.

Bad Request

_servererror The authorization server encountered an unexpected condition that prevented it from fulfilling the request

I am not sure if the issue lies on the gotosocial side, the brid.gy side or a bit of both so will raise the same issue on both gts & bridgy github pages.

GoToSocial ticket: https://github.com/superseriousbusiness/gotosocial/issues/1327

snarfed commented 1 year ago

Ah, GoToSocial! Memories of #1340. Sounds like we maybe got a bit further this time, but still not all the way?

jk-na commented 1 year ago

Yes, pretty much, been somewhat strapped for time so haven't been able to raise tickets of late. I suspect that we are close and hoping the remaining hurdles are simple enough to overcome!

snarfed commented 1 year ago

Looks like the issue is that Mastodon's API for creating OAuth apps lets you pass multiple redirect URLs in redirect_uris, separated by newlines, https://github.com/doorkeeper-gem/doorkeeper/pull/298, which Bridgy does, and it looks like GtS might not support that.

snarfed commented 1 year ago

They're tracking this in https://github.com/superseriousbusiness/gotosocial/issues/962 now. Tentatively closing here, feel free to reopen if we need to do anything on Bridgy's end!