Skip to main content

Login Methods

TwiWorks supports three different ways of allowing users to log in. You can find a short overview and some of the biggest pros/cons for these systems below.

The Login Backend

The best way to log in to TwiWorks is by running a copy of the TwiWorks Backend. This system uses a website that forms a bridge between your game and the server. It will work under virtually all circumstances, and supports refreshing user tokens (meaning you're able to keep a user logged in for longer). Unfortunately, you will need a web server (or docker host) to run the backend. You can likely run the system alongsite your existing website - all you need support for PHP and the ability to create an extra MySQL table.

Local Login

warning

The Local Login System is only recommended for small user bases.

If you'd like to avoid running a backend server, you might be able to use the local login system. This system starts an embedded local server inside of TwiWorks that acts as the backend. Unfortunately, this ease of use comes at a price. The callback URL set up with Twitch (for security purposes) requires a hard-coded port number. This means that if the user is running another application (potentially including another instance of the editor/game) on the same port, local login will fail. Furthermore, virus scanners may interfere with your game and prevent the local server from starting. Because of this, it is not recommended for mass adoption.

Hard-Coded Tokens

danger

Hard-coded tokens are not recommended.

If you want to get rid of the login process, TwiWorks supports hard-coding an OAuth token into the game. While this may work for applications that you only run yourself, your credentials are included in the game. Even when the game is packaged, mallicious actors can decompile your game and steal your credentials. For this reason we cannot recommend using this system, but it is documented use cases that necesitate it.