-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Re-using access token #194
Comments
Giving also some bit more info, in the "semi working" scenario .... This works:
This not doesn't (shouldn't it be the same thing??):
It looks like the requests have to always be made by the same client that authenticated, otherwise it doesn't work, even tho the clients look exactly the same and use exactly the same configurations 🤔 so confused. |
Hey, here's what I think the issue is ... unless I am understanding this wrong, I believe this is actually a bug in the library and a unfortunate naming issue. TL;DRthe
The Long roadWhen using oauth authentication with mastodon the flow is as follow:
Here's What is happening in the the go-mastodon library, and how things are named.
Looking deeper into the code we can see that Here's the curl example:
this being said the a) The client is effectively different The work aroundUntil a PR is accepted and merged, after using AuthenticateToken the value that should be saved is the access token in the current instance of the client. |
Got bit by this aswell. The README.md code excerpt should show how to fetch (without necessarily stating how to store) the AccessToken. Changing |
#195 I added a comment here, but I'd be down to fix this in the code :) |
I am planning to put up a PR with a RFC with a fix for this during this week. Changing the method is definitely not a great idea ... but my thoughts are around marking the method as deprecated,, to create the necessary methods to fix this issue and of course adjust all the documentation regarding this. This should ensure backwards compatibility and allow the improvement of the whole authentication flow. |
Apologies if this has been answered here, but I am having some trouble with authentication, wonder what I could be missing and if you can point me in the right direction
I'm writing a CLI application, and it contains a "configure" action
myapplication configure
that:Then an Action to create a post
myapplication -m "text"
NewClient()
Now, the problem with this is:
I am able to create a post After generating a configuration file, the next time I try to make a post re-using the exact same accessToken, I will get
Invalid_grant
If I move theAuthenticate access token
to the configuration step (before saving everything into the configuration file), When I try to create a post I getThe access token is invalid
.Do I need to request users to copy pate the link get a new token and paste and Authenticate the token every time I want to make the post?
I took a look at this issue and it's mentioned in this comment that
AuthenticateToken()
only needs to be used once, But it seems the token becomes invalid as soon as it is used once, and its not accepted if its authenticated and then re-used on another "session" of the same application.Genuinely confused.
Thanks a lot for your time and help!
The text was updated successfully, but these errors were encountered: