joscha / play-authenticate

An authentication plugin for Play Framework 2.x (Java)
http://joscha.github.com/play-authenticate/
Other
807 stars 366 forks source link

Help - Programmatically link accounts #178

Closed jaybytez closed 10 years ago

jaybytez commented 10 years ago

Any help that can be provided would be great! I am trying to build an application for production in the next month and this is one of the last requirements, but I am not clear on how the current functionality works.

Can I programmatically link an account to another account even though both use a UsernamePasswordProvider?

I have an instance where a User account is created, and then someone creates a duplicate type of account under a new email address and I want to essentially merge the accounts. Which I think could be done with the Linking. So that the main User would have the duplicate account as a linked account.

jaybytez commented 10 years ago

So the custom provider I made would not show up on the Link Accounts page. So I to the example and ran it with Twitter...copied the code that does the linking. When I put this into a page and submit it, I believe it sees that the provider type "password" is the same and skips linking and attempts to merge the account. So I modified the example user that the merge worked like the LinkedAccount and so the merge would just store a List of MergedAccounts. This worked.