I am developing an mobile app in Unity3D which uses oauth to login through my organization ADFS.
My understanding of the flow is,
- user tries to sign in
- app opens browser to oauth server for user to input credential
- oauth server returns a authorization code and redirect user back to app
- app send code to oauth server to exchange for a token
- decode token to get user details
Is my understanding of the flow correct?
How do we do this in unity3D, especially the part where browser redirects back to the app, and how does the app get the authorization code in this process?
Update:
The deep link post in the accepted answer shows how to redirect from browser back to unity app. The iOS solution also demonstrated how to pass the redirect url data back to an iOS app, but this is missing from the android section.
I did some futher googling and found out, to receive url data back in android, it involves making a plugin for Unity by overriding the UnityPlayerActivity. I have followed this tutorial with great success.