cancel
Showing results for 
Search instead for 
Did you mean: 

Facebook Authentification on Samsung Gear VR

littlebigben
Level 3
I'm developing a cross platforme VR application, Android/IOS/PC/SamsungGearVR, so I'm using Unity3D.

For the login part, I included the facebook SDK (that allows to login under Android and IOS).

The Samsung Gear VR applications are only running when they are connected to the headset, so the facebook plugin, that popup a window to login, cannot work.

I looked for a solution on the facebook developer website but didn't find good answer.
I first tought about the OAuth, but I cannot display HTML5 in 3D.

Does anybody would have an idea about it?

Thanks,
-- Benjamin
13 REPLIES 13

leftler
Level 4
Is it possible to route through the Samsung Internet Browser Beta to do the login? I have no idea if it would work or how you would do it, it is just a possible route you could try.

Edit: Also do you really need to do full HTML 5 to do facebook's OAuth login page? If the login page does not need cookies or scripting you may be able to just write a very basic web browser embedded in your app.

littlebigben
Level 3
Hi,

The Samsung Browser is an application, so I cannot use it to do an OAuth.

For the HTML5, I do not need HTML5 features, but their is no way today to display HTML in 3D under Unity 😕
-- Benjamin

leftler
Level 4
"littlebigben" wrote:
... their is no way today to display HTML in 3D under Unity 😕


Yes there is, it is just not easy to do. You could code a basic web browser inside a MonoBehavior. There may even be one on the asset store.

Doing some quick browsing "Web API Kit: Core" + "Web API Kit: OAuth Token Interceptor Extension" may do exactly what you need. (Note, I have not used either of those two packages so do your research to see if this is what you need before buying, they have a video tutorial I have not watched yet.)

littlebigben
Level 3
Thank you leftler, I'll take a look and give some feedback about it.
-- Benjamin

frankpuig
Level 2
Hi,
Was you able to figure out how to get the facebook user id / oculus username or any other login information?

I'm about to implement the login system of my game and any hint will be greatly appreciated.

mdbnet
Level 3
I managed to get this working, but it was a lot of work -

1. Created a web-view plug-in for Android and managed to copy the render buffer to a Unity texture using GetNativeTexturePtr so that it could be displayed in a floating window.
2. Intercepted clicks into the text edit view on the FB login page using getHitTestResult to detect that the user has selected a text edit box.
3. Made a 'floating-in-space keyboard' to allow user to enter their username and password in the web-page by injecting fake key-presses into the web-view
4. Followed this procedure for the sign-in: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow.

Note that if the point of the oauth path is to allow the user to enter their login and password via a trusted third-party, well, if I wanted to I could save the text that the user is entering via my custom keyboard. That suggests a fix - if Oculus were to make a floating 'system keyboard' (similar to the built-in volume widget) that would replace the popup Android keyboard, we could continue to use the standard FB SDKs. Also my floating keyboard is currently ASCII only, so a solution that would display a system keyboard for the current locale would be ideal.

LeonKleinBretel
Level 3
Hi guys,

Recently i saw that Oculus video has a facebook authenticator that seemed to work rather nice. Altough I dont know yet how to get it working. If anyone finds out please let me know aswell.
The option with a ingame webpage and floating keyboard sounds like a security issue, so I would rather not have users type in thier facebook username and password in my app.

Brainlogin
Level 4
I can't believe this is the single thread I've found on the web that even mentions the problem of not having Facebook login implemented for any of the VR platforms. I mean there have been thousands of VR game released over the past year and no one else ever complained that the Facebook SDK fails for VR simply because they haven't added support? And this is more than a year after Facebook actually bought Oculus! Why is this happening?

Brainlogin
Level 4

mdbnet said:

I managed to get this working, but it was a lot of work -

1. Created a web-view plug-in for Android and managed to copy the render buffer to a Unity texture using GetNativeTexturePtr so that it could be displayed in a floating window.

@mdbnet
Awesome, could you post your code for that?