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.
Validate username?
Re: Validate username?
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?
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?
Did you ever figure out an automatic way to do this?
Re: Validate username?
You cuould do something like this
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.
Code: Select all
time curl "https://auth.factorio.com/api-login" --data "username=${username}&password=wrong_password -o /dev/null -s
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.