-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support refreshing oauth2 token #4
Comments
Thanks to point to the references, I will look at it tomorrow!
|
I noticed that the Dart oauth2 package should do token refreshing automatically. |
I added the |
Hey, awesome! I will look at it in the next few days and come back to you. Kind regards! |
@stevenroose Hey, i just checked it over night and i made a mistake. There is a chapter on application only oauth2 here: https://github.com/reddit/reddit/wiki/OAuth2#application-only-oauth It states that applications never get a refresh token. It does not state why. So it looks to me as if you always had to get a fresh token (either once an hour or before every request). So it seems as this is not fixable. |
@Tomen The library keeps the credentials anyways, so it can keep the expiration date and manually reauthenticate when a request is made after the token expires. Should work, that is kindof how the oauth2 package does it, only they use the official refresh token mechanism. Will try to look at this tomorrow or perhaps this evening. |
@Tomen Is this issue solved for you? |
i will take a look at it in the new year. i will report to you here then. Greetings :) |
@Tomen & @stevenroose I was actually having an issue where I could not make authenticated calls at all. I realized that no authenticated calls (like get my subreddits) were in the examples. I tried to implement my own but I ran into a bunch of 403 errors everytime. Do either of you have examples on calls that NEED oauth (instead of calls that work generically, like get posts)? |
Hmm, I'll look deeper into those and see if anything becomes clear, thanks Steven |
https://github.com/reddit/reddit/wiki/OAuth2#refreshing-the-token states that the token hast to be refreshed every hour by adding duration=permanent to the authorization request. I suppose this just has to be added here: https://github.com/stevenroose/dart-reddit/blob/master/lib/src/reddit.dart#L135-L138
The text was updated successfully, but these errors were encountered: