Page 1 of 1

Validate username?

Posted: Thu Mar 02, 2017 4:47 pm
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.

Re: Validate username?

Posted: Thu Mar 02, 2017 4:54 pm
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.

Re: Validate username?

Posted: Sat Oct 14, 2017 9:13 am
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.

Re: Validate username?

Posted: Thu Feb 06, 2020 1:24 am
by aldldl
Did you ever figure out an automatic way to do this?

Re: Validate username?

Posted: Thu Feb 06, 2020 10:02 am
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.