In other languages:

Web authentication API: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (Gangsir moved page Web Authentication API to Web authentication API: Downcasing to style guide compliance.)
(add category)
Line 1: Line 1:
{{Languages}}
{{Languages}}
'''Category:''' [https://wiki.factorio.com/Factorio_HTTP_API_usage_guidelines#Internal internal]


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:
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:

Revision as of 09:46, 21 January 2022

Category: internal

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 Required. Account username.
password Required. Account password.
api_version Not required. Currently 2.
require_game_ownership Not required. If set to 'true', will fail authentication if the user account hasn't actually purchased Factorio.

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.