Supabase OAuth in Unity #154
-
Hi! More here with the code wiverson/supabase-unity-template#6 Any idea how to do? Maybe my approach is not the good one. Any help is appreciated 😅. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The short answer is that you would have to open up a web view to start the flow, and then have a way to get the completed flow back to the native app. It's doable, but it's non-trivial. You'll need to coordinate between your Unity app, a custom web app you will have to write, and then have a way to get the session info back again from the custom web app after the flow is completed with the OAuth provider. This could be done by having some kind of WebSocket or polling back to the server from the Unity client. You can see an example of how a flow like this works eg with the JetBrains toolbox when you log in, except that the flow would also have to include kicking over to the 3rd party OAuth provider as well as your own web server. Technically you have all of the tooling you need to build this between the Supabase JS client for the custom web app and the C# lib for the Unity project. But it's not just a oneliner login or anything. |
Beta Was this translation helpful? Give feedback.
-
A solution here wiverson/supabase-unity-template#7 (reply in thread) |
Beta Was this translation helpful? Give feedback.
The short answer is that you would have to open up a web view to start the flow, and then have a way to get the completed flow back to the native app. It's doable, but it's non-trivial. You'll need to coordinate between your Unity app, a custom web app you will have to write, and then have a way to get the session info back again from the custom web app after the flow is completed with the OAuth provider. This could be done by having some kind of WebSocket or polling back to the server from the Unity client.
You can see an example of how a flow like this works eg with the JetBrains toolbox when you log in, except that the flow would also have to include kicking over to the 3rd party OAuth…