-
Notifications
You must be signed in to change notification settings - Fork 27
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
Using an AccessToken that is already in use by another user? #21
Comments
Good Question. I've been thinking about ways to do this, nothing in stone yet. One thing, the AccessToken shouldn't ever belong to a different user, that would be a bug. Do you mean "the user already has logged in with that service" instead? Could you describe the exact flow of events you have in mind so I can better figure something out? Thanks, |
Yes. The token doesn't ever seem to get created. But, in theory, we've got the credentials at this point, right? That's how we know the user is already connected? So we could make, say, a mock-token to make API calls with, without actually saving the token to the DB? Flow of events: User B tries to edit his account, to add credentials for Network X, User#update's user.update_attributes call will set result as false, and the record At this point, I want to update the flash with [username for the authentication with Network X], Did that make any sense? |
Hey! Nice examples, makes things clear. Flow of events:
I was thinking that's what you meant. How is that possible? It doesn't seem like that should even be possible. For example, take Twitter...
I don't think you can even do that with OAuth, as that would mean you're allowing them to pass in their user name to twitter and go through oauth... Am I missing something? I can see this working if you are trying to do the following. User A is trying to dupe the system and create User B (so, say, I can have two user accounts so I can get 10GB of email vs. 5GM :p), so User B tries to associate his Twitter account to User B but they've already added it to User A. Is that what you're describing? If you are describing this create-multiple-accounts situation, I haven't thought about that, we'd have to sit down and work something out. What are your thoughts? |
i had a brief discussion with andrew about a related issue, and i believe this is indeed about this "create-multiple-accounts" situations - at least, it is for me :). let's say, the following is true:
another is to attempt doing something automagically, like merging the two accounts - which has the potential to be ugly, but might work for most cases - and would provide a pretty seamless experience for most users cheers |
Did behavior for this change recently? Today's the first time I've poked around with it in a while; now, if I authorize an already-authorized account, it gets linked to the current user, and the other user loses its access token. |
Is there a way to access the AccessToken returned from the OAuth provider before/after a save/update_attributes fails due to the AccessToken already belonging to a different user?
I'd really like to be able to query the API using the new AccessToken so that I can, e.g., pull the user name of the AccessToken to present in the error message, so that instead of saying:
"Sorry, that Twitter account is already linked", I could say "Sorry, the Twitter account [username] is already linked."
The text was updated successfully, but these errors were encountered: