colyseus / colyseus-social

Authentication and Social features
https://docs.colyseus.io/tools/colyseus-social/
MIT License
21 stars 17 forks source link

OAuth2 support #6

Open HeadClot opened 5 years ago

HeadClot commented 5 years ago

Hey bit of a feature request but would it be possible to get OAuth2 support for colyseus-social?

endel commented 5 years ago

Hi @HeadClot, I'd definitely like to add this in the near future. Which client are you using @HeadClot? I hope I can integrate this nicely for Unity3d as well. Cheers!

HeadClot commented 5 years ago

Hey Endel, That is good to hear that it will be added in the near future. I am currently using the Unity3D integration for my project.

endel commented 5 years ago

I've started implementing this in the oauth branch today. I'm using the grant package that supports multiple providers via a JSON configuration file containing all the key/secrets of selected providers.

The way it currently works is:

To allow a similar behavior on Unity's native builds (desktop, ios, android, etc), I believe the Unity app would need to create an HTTP server (example), and instead of using postMessage(), the final URL in @colyseus/social would send the data through a POST request to the local server Unity has created.

If you have any suggestions or a better alternative please let me know 😅