Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Save OAuth tokens #2810

Merged
merged 5 commits into from
Oct 17, 2014
Merged

Save OAuth tokens #2810

merged 5 commits into from
Oct 17, 2014

Conversation

Changaco
Copy link
Contributor

We need that for #2809 if we're going to show suggestions about who to tip based on elsewhere data.

I've included the simplate I used to check that it works for Twitter and GitHub. Still need to confirm that it works with the other OAuth platforms (Bitbucket, Facebook, Google, OpenStreetMap and Venmo), feel free to help (especially with Venmo since I can't test that).

@chadwhitacre
Copy link
Contributor

Why no tests? This isn't fixing an urgent production issue, for example.

BEGIN;
ALTER TABLE elsewhere DROP COLUMN access_token,
DROP COLUMN refresh_token,
DROP COLUMN expires;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the data that's already in these columns? It looks like we're throwing it away, yes? Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because keeping it is not worth the effort, it only exists in 59 rows (Venmo accounts), and I think it might be obsolete anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. We've been using an OAuth app for Venmo that is attached to my personal account. Due to bugs on their end we were unable to set up an app under our Gratipay account, but I believe that's resolved now. What are the implications of throwing away these access/refresh tokens? Does it make sense to also switch to a different Venmo OAuth app along with this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if we want to change some OAuth keys now is the time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll look into it.

@chadwhitacre
Copy link
Contributor

Venmo looks good. We end up with the entire user object in the token json, for a bit of bloat. I do see the refresh_token in there as well, so we're not losing that.

@Changaco
Copy link
Contributor Author

Why no tests?

We can't really test interactions with the elsewhere platforms.

There may be other things we could cover in the tests though, I haven't really looked into it, I wanted to get this PR opened.

@chadwhitacre
Copy link
Contributor

I have the new Venmo app ready to go. Can we think this through? So we're tossing away these access and refresh tokens. That doesn't matter, because we aren't actually using them for anything yet. In fact, once a Venmo connection is made, that's all we care about: that a connection is made, that we have a Venmo user id to include in venmo-account.html.

@chadwhitacre
Copy link
Contributor

Specifically: we're not using Venmo as a sign-in method.

@chadwhitacre
Copy link
Contributor

I've switched over to the new Venmo app, and I've deleted the old one.

@rohitpaulk
Copy link
Contributor

I'm closing #1995, leaving this comment here for reference.

@Changaco
Copy link
Contributor Author

@whit537's commits LGTM. I guess what's left to do here is to test the remaining platforms: Bitbucket, Facebook, Google, OpenStreetMap.

@chadwhitacre
Copy link
Contributor

I just created oauthlib/oauthlib#283 so we can be notified when oauthlib 0.6.4 is released. We're currently using a non-released version.

@chadwhitacre
Copy link
Contributor

I guess that's an FYI. Not directly related to this PR but I just happened to be reminded since this is oauth code.

@chadwhitacre
Copy link
Contributor

IRC

@chadwhitacre
Copy link
Contributor

Bitbucket and OpenStreetMap both populate elsewhere.token with OAuth1-appropriate date. Facebook and Google both include access_token and expires_in (per OAuth2), but I'm seeing refresh_token for neither.

@chadwhitacre
Copy link
Contributor

Venmo gives us both access_token and refresh_token.

chadwhitacre added a commit that referenced this pull request Oct 17, 2014
@chadwhitacre chadwhitacre merged commit 851f4cd into master Oct 17, 2014
@chadwhitacre chadwhitacre deleted the save-oauth-tokens branch October 17, 2014 15:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants