kensanata / mastodon-archive

Archive your statuses, favorites and media using the Mastodon API (i.e. login required)
https://alexschroeder.ch/software/Mastodon_Archive
GNU General Public License v3.0
358 stars 33 forks source link

Invalid scope when re-authorizing for expire #33

Open deshipu opened 5 years ago

deshipu commented 5 years ago

I'm trying to expire my old toots from mastodon.technology with the following command:

mastodon-archive expire --older-than 4  CENSORED@mastodon.technology --confirmed

and when I follow the URL for authorization:

https://mastodon.technology/oauth/authorize?client_id=CENSORED&response_type=code&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=read+write

the instance shows me a message saying "The requested scope is invalid, unknown, or malformed." Changing the scope to just "write" results in the same error, though changing it to "read" makes it work.

deshipu commented 5 years ago

It may be related to https://github.com/tootsuite/mastodon/issues/183 but I don't understand what the solution was.

kensanata commented 5 years ago

You think that the scopes need to be the same when registering the client and when authorizing the client? If so, delete the two *.secret files before expiring toots. If that works, then perhaps that's what we should do: re-register the application before attempting to authorize.

deshipu commented 5 years ago

That worked, thank you!

xakan commented 5 years ago

Hello,

I got the same issue, even after deleting the two *.secret file.

I also tried to delete authorization and authorize mastodon-archive again, but with no success.

Do not hesitate if you want more information.

I was trying to expire all toots of xakan@hostux.social.

deshipu commented 5 years ago

After you delete the .secret files (and possibly also the authorization), be sure to authorize with the read+write scope, not the read scope again.

xakan commented 5 years ago

Hello again,

To give more informations : First I made an archive with --with-mentions option. When deleting *.secret files, I had an invalid scope message.

I removed my archives and made a new one without --with-mentions option.

I delete the .secret file and tried to expire toots and favourites -> that went fine.

I don't know if it will help. But thank you for your help!

kensanata commented 5 years ago

Looks like we really need to do this. Or, alternatively, we could always use read- and write scope. Perhaps that would be simpler?