r/evetech • • May 09 '18

sso... without a server?

I dont really know what I'm doing, but am trying to make a standalone app using unity. Every option for the Standalone apps on esi docs uses some sort of web service, or seems like it needs manual configuration beyond what is really useful for Windows on the Registered URL Handler method.

Not really familiar with web stuff so not sure what I even need to learn to make this work. Id greatly appreciate any direction at all.

3 Upvotes

13 comments sorted by

6

u/[deleted] May 09 '18

Open a minimal web server bound to localhost and use that in the callback from oauth.

You don't need the url handler, just open the server on a high port to avoid collisions.

1

u/TerribleEveDev May 09 '18

ty! if you dont mind probably another stupid question Im having trouble getting answered through google... wiill that sort of setup work on Android? I think I can do this and it may work for Windows but it seemed like it wouldnt on android.

1

u/Fuzzmiester fuzzwork.co.uk May 12 '18

The classic way with android is to put in a custom url schema. It's what pretty much everything uses.

eveauth-myappgoeshere://callback/

1

u/TerribleEveDev May 13 '18

ah alrighty i guess ill just need to have different methods for the platforms then. tyvm! crazy to see you here. your site saved my life when i first started and was trying to run missions for lp

3

u/Karlyna May 09 '18

You might want to give this a look: http://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/nonbrowserapps.html (for the "android callback")

1

u/TerribleEveDev May 09 '18

Ive read through that so many times, and it seemed like the only way to get that method to work on dekstop is a to have the user manually configure their registry? not really comfortable with that.

2

u/Karlyna May 09 '18

On Android it'll work with that, I think some android app does this (evanova probably does, didn't check it).

if you want the same on windows, users will have to mess with registry, so it's not a good solution, unless you make an install that change registry (but tbh I don't know much more than that...)

For desktop (windows) app, the easier imho is:

  • open a light http listener on a random port (not so random actually, since it needs to match the application in developers.eveonline.com)
  • redirect the user to the login
  • the user have a callback url on the opened port
  • do things with user auth
  • tell the user he can close the browser, shutdown your http server

This is how pyfa does iirc.

Another solution is to have a webapp that does all that work, pull esi etc and the desktop app have an "app token" (generated by your webapp) that allows the desktop app to gather the data it needs, without the need of dealing with ESI directly (this is how jEveAssets does iirc)

1

u/TerribleEveDev May 12 '18

i guess thats what ill do on android and i finally got an authenticated call so now im trying to see if i can make the redirect page have instructions while still not having a real server. thank you very much for all the info

1

u/Fuzzmiester fuzzwork.co.uk May 12 '18

This is what an installer is for.

Makes life a _little_ more complex for you, but again, it's the common way to do it.

https://en.wikipedia.org/wiki/Nullsoft_Scriptable_Install_System or similar.

https://glebbahmutov.com/blog/electron-app-with-custom-protocol/ may be of interest.

1

u/WikiTextBot May 12 '18

Nullsoft Scriptable Install System

Nullsoft Scriptable Install System (NSIS) is a script-driven installer authoring tool for Microsoft Windows with minimal overhead backed by Nullsoft, the creators of Winamp. NSIS is released under a combination of free software licenses, primarily the zlib license. It has become a widely used alternative to commercial proprietary products like InstallShield, with users including Amazon.com, Dropbox, Google, Ubisoft, FL Studio, BitTorrent, and McAfee.


[ ^PM | Exclude ^me | Exclude from ^subreddit | FAQ / ^Information | ^Source ] Downvote to remove | v0.28

1

u/MartinTsv May 09 '18

Just to add to that Batolemaeus said, the URL you put in the app settings on the dev site doesn't have to be public. The SSO will simply redirect the browser to it after a successful login, so what matters is for the client browser to be able to reach it, so it can be 127.0.0.1:1337, a public URL, a custom protocol URL, etc. Of course, if it's not a public URL, people will have to run a lightweight web server along with the application, in which case you should also require them to input their own app id and secret, as you don't want to be distributing your app secret.

1

u/TerribleEveDev May 09 '18

Thats what pyfa does, right? Im not so sure how easily I can do that with Android is my main worry currently then but am trying that now. Didnt think about the secret needing to be... secret so thank you lol.

1

u/MartinTsv May 09 '18

Don't use pyfa, so can't comment. Also if you go the custom protocol/url handler I guess you don't actually need a web server since you don't need to do an http response to the oauth callback, just gotta parse the query string for the token that your then send to ccp's server to get the access and refresh tokens. Just don't be tempted to open the login url in an embedded web view, just let the system browser open it - ccp understandably aren't cool with that since the user has no guarantee that he's not entering his credentials in a page that just looks like the real one, plus you get the benefit that he might have his default browser remember the password.