Auth Module

Auth module is one of the core modules of MST. As the name suggests, it performs user authentication logic. This module supports several types of authentication:

  • Guest authentication
  • Sign in. Username and password authentication
  • Sign up. Username, email and password authentication
  • Token authentication
  • Email authentication

Inspector

  • UsernameMinChars - The minimum number of characters allowed in the user name.
  • UsernameMaxChars - The maximum number of characters allowed in the user name.
  • UserPasswordMinChars - The minimum number of characters allowed in the user password.
  • EmailConfirmRequired - If this parameter is enabled, the user registration using a username and password is carried out with confirmation of his email.
  • EnableGuestLogin - If this option is enabled, guest users can authenticate.
  • GuestPrefix - the prefix of the guest username to be used when creating the username.
  • SaveGuestInfo - If this option is enabled, guest users will be able to save their data to the database and receive it when re-authenticating. Otherwise, guest users will only be able to use temporary data at the time of gameplay.
  • TokenExpiresInDays - The lifetime of the authentication token.
  • GetPeerDataPermissionsLevel - Permission level for performing operations with peer account.
  • Mailer - The script that performs the sending of e-mail.
  • EmailAddressValidationTemplate - Template for validating the user's email address.
  • ServiceCodeMinChars - The minimum number of characters used in generation of service code.
  • DatabaseAccessorFactory - Used to access the user database. See database accessors.

Guest authentication

This type of authentication is intended for users who log in as guests. All that is needed to use this system is the user's device ID. Demo is available.

Sign in with username and password

This type of authentication is intended for users to log in to the application using their username and password. Demo is available.

Sign up with username, email and password

This type of authentication is intended for users to register in the application using their username, email and password. In this case, Mailer must be enabled. See below. Demo is available.

Token authentication

This type of authentication is used if you have a token. The token can be obtained with each authentication method mentioned above or when logging into the application via social networks. Demo is available.

Email authentication

A common type of authentication in which the user only enters his email address and receives a login and password created by the system to it. In this case, Mailer must be enabled. See below.

Mailer

This is a script that performs the sending of e-mail. It must be connected to the authentication module as shown in the screenshot below.

Mailer has its own settings, email credentials. All these settings you can get from your email provider.

You can also configure your mailer using application.cfg file. Using application.cfg and command line arguments

As you probably noticed mailer has a parameter called email body template. It is designed to create the design of your email. You can create your own template and paste it into this field. You can find an example of the template in the folder MasterServerToolkit -> MasterServer -> Resources -> Htmls.