PlayEveryWare / eos_plugin_for_unity

Repository for PlayEveryWare's EOS Plugin for Unity, bringing the functionality of Epic Online Services to the Unity Game Engine.
https://eospluginforunity.playeveryware.com
283 stars 55 forks source link

Device Auth Url Link #25

Closed RobSuperNimbus closed 3 years ago

RobSuperNimbus commented 3 years ago

Hey,

Im trying to figure out the device auth flow. I have it all working but when I call AuthInterface.Login() it prints out a URL to the console that I then manually have to copy and paste into my browser. Im trying to figure out either how to make this automatic so the browser window will popup for the user with the link supplied or where in the code this link gets printed so I can access it and pop up the browser myself in my own code.

Any insight would be great.

Regards Rob

adrianpew commented 3 years ago

Hi Rob,

The EOS SDK should automatically pop up the browser in the current shipped version with the plugin (1.13.0).

Can you tell us more how you're logging in? In the 'Auth & Friends' sample, we call into EOSManager.StartLoginWithLoginOptions (included in plugin):

https://github.com/PlayEveryWare/eos_plugin_for_unity/blob/31ef5666da20314639e559af05674505f11c915b/Assets/Plugins/Source/EOSManager.cs#L671

EOSManager is included in the plugin as an entry point into calling EOS SDK.

RobSuperNimbus commented 3 years ago

Hey Adrian,

The Epic Online Services Version is 1.13.1 but the Epic Online Services Unity Plugin is 1.0.1. This correct? I changed my code to use what you have above EOSManager.Instance.StartLoginWithLoginOptions(loginOptions, (LoginCallbackInfo loginCallbackInfo) => {//some code}); but it still just prints out the url in the debug log and does not popup. Im running this in the Unity console. Its not a build or anything if that makes a difference.

These are my login options: var loginOptions = new LoginOptions() { Credentials = new Credentials() { Type = LoginCredentialType.DeviceCode, Id = "RobSuperNimbus", Token = SystemInfo.deviceUniqueIdentifier.ToString() } };

adrianpew commented 3 years ago

Investigating what behavior is expected from Epic API.

In the meantime, have you tried running the samples and see if Account Portal auth launches browser in your environment?

Can you also clarify: "Im running this in the Unity console", are you running in Unity Editor?

RobSuperNimbus commented 3 years ago

Yeah the account portal opens the browser. And yeah I meant the Unity Editor. But as I said the account portal opens from there so I assume the device auth should also.

adrianpew commented 3 years ago

https://dev.epicgames.com/docs/services/en-US/API/Members/Enums/Auth/EOS_ELoginCredentialType/index.html

"DeviceCode: Deprecated and no longer used. Superseded by the EOS_LCT_ExternalAuth login method."

What platform are you targeting?

RobSuperNimbus commented 3 years ago

Im targeting windows at the minute. I would assume externalAuth is not a viable replacement for device auth as it seems to be for 3rd party authentication.

adrianpew commented 3 years ago

I believe external can be used on PC, you would just have to use Epic Account, Steam, or Windows Account, depending on which launcher is starting your title: https://dev.epicgames.com/docs/services/en-US/API/Members/Enums/NoInterface/EOS_EExternalCredentialType/index.html

If you're looking to have a device code work on PC, you can try posting your question on the Epic forums

It sounds like you want to use DeviceCode on PC, but that doesn't look like a current options. You mentioned the console prints a url, have you tried parsing and having Unity launch a browser?

Without fully knowing your scenario, I recommend trying external auth (Connect), which could use the authentication for the pc platform you're targeting (epic store, steam, windows account): https://eoshelp.epicgames.com/s/question/0D54z00006vRhG2CAK/how-to-authenticate-user-in-eos-on-streaming-platform-where-user-has-no-ability-to-exit-exclusive-full-screen-game-mode?language=en_US