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

Token refresh #4

Open
richoakley opened this issue Sep 29, 2014 · 11 comments
Open

Token refresh #4

richoakley opened this issue Sep 29, 2014 · 11 comments

Comments

@richoakley
Copy link

Is there a way to handle refreshing tokens?

@rigelstpierre
Copy link

Also looking to do this.

@rigelstpierre
Copy link

I'll leave this here for anyone else who has trouble with the refresh token.
https://gist.github.com/rigelstpierre/07d461911182e3cb3480 I used these on an app I wrote.
I'm not sure how'd I go about adding it to the gem but here is how I used it. The spotify method was called from the user. I stored the refresh_token, auth_token and expires_at on the user table in the database. Worked pretty well for us once we got the BASE_64 encoding correct, hardest part really.

@richoakley
Copy link
Author

Thanks for sharing this Rigel! Will see if I can find a way of building it into the gem and then pull-request it.

@seanders
Copy link

+1

@JordWyatt
Copy link

Any update on this?

@masterkain
Copy link
Member

do we have any other example of an omniauth2 gem that includes token refresh? I'm not entirely sure it belongs to this gem's domain since everyone has a custom method for this.

Opinions about that are appreciated.

@justinthiele
Copy link

@rigelstpierre Thanks for posting your solution, worked perfectly! 🎉

@gfauredumont
Copy link

Looks like what your looking is done by RSpotify, a gem to request Spotify's API (including ouath methods for private data), has a way of doing this: from the readme:

The user's access token is automatically refreshed by RSpotify when needed

We're using omniauth-spotify because we already use Devise and omniauth-facebook on our project so it should integrate seamlessly...

Unfortunately, changing the callback_url in devise's configuration seems not implemented here :/

@masterkain
Copy link
Member

I've yet to push the new gem on rubygems because I want people to try out the redirect issues they're having, can you try the current master in your Gemfile?

158a324

@gfauredumont
Copy link

Hi !

Just tested it and IT WORKS !
I had seen this differences between omniauth-spotify and omniauth-facebook but I wasn't sure it was what caused my issues. Thank you !

So I for one would love to see that update go to RubyGems.
How can we help ? I'm probably not as good as you are, but I can probably help anyway, right ?

@masterkain
Copy link
Member

0.0.10 has been pushed to rubygems, thanks for testing!

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

7 participants