microsoftarchive / botauth

Authentication middleware for the botframework
MIT License
73 stars 78 forks source link

Account linking example with facebook #7

Open tayzlor opened 7 years ago

tayzlor commented 7 years ago

Hey there, Cool module! I'm looking at implementing an account linking example using a facebook messenger bot. I notice the example you've got around this is incomplete.

Have you had any success with trying to implement account linking with OAuth end to end?

mattdot commented 7 years ago

I was refactoring some stuff to try to get that working, but that effort turned out to be bigger than I planned and I haven't been able to complete that branch yet. What OAuth provider are you looking to use with FB Account Linking?

tayzlor commented 7 years ago

I'm working with Pinterest - but the mechanics are pretty much the same as the FB one.

I'll do up a separate PR to add an example for Pinterest (non account linking) later today.

mattdot commented 7 years ago

thanks for the PR, you can see where I'm headed on the "providers" branch. It's non-functional right now. Basically I had to create a different set of dialogs for FB account linking (and other native auth flows in the future). Each set of dialogs and redirects will be packaged up as a "flow". Flows can be triggered per channel, so when you're on facebook you'll get fb account linking flow, but when you're on skype you'll get the magic code flow.

Also I was making assumptions about passport strategies that not all strategies implement, so starting to break out different providers. Hopefully this would also let people implement providers which are not based on passportjs.

You can see how this refactoring got so huge, but if I can figure out how to put it all together it should make the library much better and more future proof.