Open noqqe opened 1 year ago
Had the same issue. Turned on debug logs for gotosocial and it reported missing "redirect_uri" for the c.Authenticate(..., email, password)
call. Can be seen missing it in the source.
Solved it by using auth token workflow instead:
app, err := mastodon.RegisterApp( ...
...
fmt.Println(app.AuthURI)
fmt.Println("Open this URL in your browser, login, aprove, get token and enter it here:")
var auth string
_, err = fmt.Scanln(&auth)
...
c := mastodon.NewClient(...
...
err = c.AuthenticateToken(..., authToken, "urn:ietf:wg:oauth:2.0:oob")
...
fmt.Println("Your permanent access token is:")
fmt.Println(c.Config.AccessToken)
Do this once, when registering your application, then store your access token. Whenever you want to connect a client you simply provide the token and nothing else:
c := mastodon.NewClient(&mastodon.Config{
Server: "localhost",
AccessToken: "yourstoredtoken",
})
Im trying to send a Toot to a gotosocial instance. While its working perfectly fine sending a Toot to a Mastodon Instance, it does throw an
invalid_request
error to gotosocial.The code that I use for reference
This is the error that I get
This is in the logs of gotosocial.
And the corresponding part on the gotosocial side of auth is https://github.com/superseriousbusiness/gotosocial/blob/694a49058951de31cca4ea061e2c08d44e712612/internal/api/client/auth/token.go#L32-L55
I'm not entirely sure what the cause, someone else having this issue or am I doing something wrong?