How to catch a URL in browser

Hello,

I’m trying to make a login system that uses Facebook, Google and others.
I got everything pretty much setup and works when I debug it.
My biggest problem is that when I want a user to login via google/fb I send them to a login page that when they finish logging in, they are moved to a site like https://www.mysite.com/?code=3uif32fh32f
I’m having trouble getting that code from the site, I even got this plugin - https://assetstore.unity.com/packages/tools/integration/universal-deep-linking-pro-seamless-deep-link-and-web-link-assoc-135654
But still it didn’t help me much.

Is there anyway to get a url link from an opened browser?

Thanks

to get url from users browser(s) would be bad idea, since it means your application has to “spy” other applications and their data, and then at any point your app could easily record all web page urls that they visit… (and probably exe might get more easily blocked by antivirus etc).

alternatives:
could embed browser into your app:
and then listen its result pages etc. (asset store has desktop browser plugins, that should be able to do that)

if the return url is your own site,
you can have backend system to check that key, and your own app can connect there,
but still if login happens in separate browser, you still need something to identify the user.

i guess should be using something like this,

Hmmm so you’re saying it would make more sense to just open an in-game browser to get the result.
I think I was pretty misinformed on the whole deep-linking front and didn’t understand it fully.
Ok, I’ll try it with that, will update if it did the trick.
Thanks,

i think with deeplinking, your return url should be using custom protocol, to be opened in your app, like:

yourgame:code=12312345

i guess if your current return url is at your own site,
you could have link or redirect there to your deeplink protocol.

Hmm do you have any examples for asset store items that do it? I’ve searched quite a bit but found nothing that seems to do the trick.

browsers,

Thanks, they are a bit pricey.
So I guess there aren’t any free ones.

Is there another way to get said URL?
Maybe best way is to have it connect to my website and have like a link the user just has to paste.
I wonder if this is just a problem with Unity cause a lot of programs has this functionality and it doesn’t seem to be that much of a problem.

maybe some free ones, like (more if search github)

other options,
https://firebase.google.com/docs/auth/unity/google-signin

just curious, which applications or tools have that feature? (are they opening browser, or login is embedded)

In terms of auth etc, I’m using AWS Cognito and got everything running from FB to google and other 3rd party stuff. Most of them require me to get some code in order to verify the login. So pretty much all I have to do is get the code and its working. I also got it working for me on android/iphones I just trying to make it work on PC as my app is cross platform.

Now, I cant think of specific apps that do it exactly like that, a lot of them have it embedded, depends if its mobile or not.
Some however do it that when you click login with google, you get a popup with your google accounts and once you clicked one it signs you in, same for FB.
I do a similar thing, as when the user clicks to login via 3rd party, it opens a new windows with FB/Google/etc and from there it sends you to your google/fb accounts. Only problem is that I can’t seem to get that URL as I hoped to. I’ll keep searching for more info on opening a browser in game, hopefully it lets you get back the url thats presented and not just show it.

pretty sure all of those will connect to that server backend,
to get login verification code. (see the OAUTH2 integeration guide)

AWS seems to have external providers too, to login with google, fb etc. so that should work:

AWS indeed has that, and with how much of a mess their documentations are, it is working. But, at the end you create a URL that opens a hosted cognito site with external providers and you can login from there (works great for android/ios) but on Windows, you still need to get that code from the redirect URL that cognito sends the user to.
At the end I bought - https://assetstore.unity.com/packages/tools/gui/embedded-browser-55459 cause theres no normal free web browser for windows.
So far its been great, got the code back in around 4 minutes which was nice.
Got it working for facebook only problem I’m facing is that google doesn’t trust the embedded browser so cant login with google now, thats a new problem by itself.
And also it doesn’t know your users (such as logged in google accounts) and you need to manually enter your username and password, maybe theres a way to connect them back to the embedded browser but need to research that.

Thanks