Web authentication API: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Created page with "Category:Technical Factorio's Web Authentication API endpoint gives you a token in exchange for your username and password, which is used by several other Factorio web API...")
 
No edit summary
Line 14: Line 14:
|}
|}


This endpoint always returns JSON encoded data. If authentication was successful, it will return a JSON list containing a single item: the auth token. The auth token seems to always be a hexadecimal encoded 15-byte string of random bytes.
This endpoint always returns JSON encoded data. If authentication was successful, it will return an HTTP status code of 200 with a JSON list containing a single item: the auth token. The auth token seems to always be a hexadecimal encoded 15-byte string of random bytes.


TODO: exceptions and stuffs.
TODO: exceptions and stuffs.

Revision as of 04:05, 8 January 2017

Factorio's Web Authentication API endpoint gives you a token in exchange for your username and password, which is used by several other Factorio web API endpoints. The authentication endpoint is located at:

https://auth.factorio.com/api-login

Authentication requires sending an HTTP POST request with these parameters:

username Account username.
password Account password.

This endpoint always returns JSON encoded data. If authentication was successful, it will return an HTTP status code of 200 with a JSON list containing a single item: the auth token. The auth token seems to always be a hexadecimal encoded 15-byte string of random bytes.

TODO: exceptions and stuffs.