Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing field scope when authorizing agains snac2 mastodon api #258

Open
AkkermanD opened this issue Nov 7, 2024 · 1 comment
Open

missing field scope when authorizing agains snac2 mastodon api #258

AkkermanD opened this issue Nov 7, 2024 · 1 comment

Comments

@AkkermanD
Copy link
Contributor

Hello! I'm facing an issue while trying to authorize against the snac2 mastodon api.
The fetch_access_token returns an error: missing field scope at line 5 column 1

Snac supports subset of the mastodon's API, but it does not return the scope field, if there were no such field in the request: https://codeberg.org/grunfink/snac2/src/commit/2769e6b1d76b1043f8d8cdb928a95ade48b8ebff/mastoapi.c#L404

Megalodon does not send the scope field: https://docs.rs/megalodon/latest/src/megalodon/mastodon/mastodon.rs.html#135

But it looks like it is Ok for oauth server to not return scope in the response, if it is identical to the scope requested by the client: https://datatracker.ietf.org/doc/html/rfc6749#section-5.1

scope
OPTIONAL, if identical to the scope requested by the client;
otherwise, REQUIRED.

I'm not sure if it worth to add new SNS for the snac to fix this. Can we make scope field optional in the TokenDataFromServer struct?

@h3poteto
Copy link
Owner

There is no problem changing scope to an optional field, but it's better to add snac2 as a new SNS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants