Validate username?

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
Natha
Fast Inserter
Fast Inserter
Posts: 173
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Validate username?

Post by Natha »

Hi,
is there a possibility (URL API e.g.) to ckeck if a given Factorio username is valid? It would also be great if I can check if a given token belongs to this name.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Validate username?

Post by daniel34 »

I have found that you can check if a username is valid using the mod portal. An url of the form https://mods.factorio.com/mods/username will give a proper page with username and (optionally) mods listing if the username exists, but will return a simple "Not Found" page if it doesn't.
quick links: log file | graphical issues | wiki

Natha
Fast Inserter
Fast Inserter
Posts: 173
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: Validate username?

Post by Natha »

Hi, I'm sorry but I can NOT recommend this method, because it wil return 404 NOT FOUND also if a user never logged in to the mod portal, but still exists.

aldldl
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Jan 08, 2019 1:08 am
Contact:

Re: Validate username?

Post by aldldl »

Did you ever figure out an automatic way to do this?

wanne
Inserter
Inserter
Posts: 24
Joined: Tue Jan 28, 2020 7:24 am
Contact:

Re: Validate username?

Post by wanne »

You cuould do something like this

Code: Select all

time curl "https://auth.factorio.com/api-login" --data "username=${username}&password=wrong_password -o /dev/null -s
Responses are much faster when the user does not exist.
You have to balance that with your Internet connection. But just do it 10 times with a user known to be not existing and compare it to your user. If your request is more than 100ms slower in median the user does not exist. If not not. At the moment that works really fine. Response times for nonexisting users are very stable. Existing users are much slower.

Post Reply

Return to “Technical Help”