- Home /
How to add custom SSO (Single Sign On) login in Unity 3D application?
Hi, I am in need of adding a Single Sign on feature in my game with our internal login system.
I've added Single Sign On with facebook earlier, but in this case,
I will need to add SSO with my company's internal authentication system (called Ultimatix in TCS).
NOTE : The company's authentication system (Ultimatix) supports SSO with web applications. But I am unsure whether it can be reused for Unity 3D applications.
So kindly guide me in terms of what SDK (if relevant), would be required to add for integrate SSO with our back end system.
Any lights thrown into this topic is welcomed.
PS : My game is targeted into both android and iOS. So I am wondering, will that add any complexities into the above requirements?
Answer by anilhdas · Mar 23, 2017 at 11:32 AM
So as me and my team mate was breaking our heads on it, finally we found a solution.
You can render a web page inside Unity using plugins from Asset store (You can find a detailed answer about this here)
Register the app name with your company's authentication system, (Ultimatix, in this case).
You will get an App Id, an App secret and a callback URL.
When the game begins, load the authentication URL (You can get this by inquiring to your company's authentication team).
While you load the URL, pass the app id and callback URL as parameters.
Now when the authentication is successful, user would be redirected back to the 'callback URL'.
When the redirection happens, you will have all the data that you need as part of the response (like email id, name, etc) depending on your company's policies.
Store it some where in Playerprefs or a local db and load the next scene.
That's it.
Hope this helps someone else, Happy developing :-)
Hi, Thankyou for your answer, really helpful. I don't understand Step 7: "When the redirection happens, you will have all the data that you need as part of the response (like email id, name, etc) depending on your company's policies. ". Using WebView plugin how were you able to parse and store data from the server response (email id, name etc). There is no way documented, the plugin seems to simply render a webpage in unity and nothing else. Did you use Unity WWW class or HTTPClient in C# to get the html markup of the redirected URL and parse the user data from that ?