Custom passwords

The TeamSpeak SDK optionally allows you to do custom password handling. This allows to check TeamSpeak server and channel passwords against an outside datasources, like LDAP or other databases.

To implement custom passwords, both server and client need to add custom callbacks, which will be spontaneously called whenever a password check is done in TeamSpeak. The SDK developer can implement own checks to validate the password instead of using the TeamSpeak built-in mechanism.

Password Encryption

Both Server and Client Lib can implement the following callback to encrypt a user password. This function is called in the Server Lib when a virtual server or channel password is set.

This can be used to hash the password in the same way it is hashed in the outside data store. Or just copy the password to send the clear text to the server.

struct ServerLibFunctions

Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly.

Public Members

void (*onClientPasswordEncrypt)(uint64 serverID, const char *plaintext, char *encryptedText, int encryptedTextByteSize)

called when a server or channel password is set.

Used to hash the password or encrypt it for check with outside sources.

Param serverID:

the server for which the callback was called

Param plaintext:

the plaintext password to be encrypted.

Param encryptedText:

the encrypted/hashed password. Fill with your encrypted password. Must be an utf8 encoded c string not larger than specified by encryptedTextByteSize

Param encryptedTextByteSize:

the maximum number of bytes you may write to encryptedText

Password validation

Server password

Implement this callback in the server to check the password provided when a client connects to this server against an outside database. The callback is called whenever a password check is performed, even if no password is set.

struct ServerLibFunctions

Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly.

Public Members

unsigned int (*onCustomServerPasswordCheck)(uint64 serverID, const struct ClientMiniExport *client, const char *password)

called when a client connects to the server. Used to verify the server password when using custom password encryption.

Param serverID:

the server for which the callback was called

Param client:

describes the client that connects to the server

Param password:

utf8 encoded c string containing the password provided by the client.

Return:

a value from the Ts3ErrorType enum. ERROR_ok if the password is valid, ERROR_server_invalid_password if the password is not valid, ERROR_parameter_invalid if the password is in invalid format.

Channel password

Implement this callback in the server to check the password provided when a client enters a password-protected channel against an outside database. The callback is called whenever a password check is performed, even if no password is set.

struct ServerLibFunctions

Server callbacks. Zero initialize and set members to functions that are to be called when the event in question happens. Every callback you use should exit quickly to avoid stalling the server. If you need any expensive activity upon receiving callbacks, consider starting the activity in a new thread and allow the callback to exit quickly.

Public Members

unsigned int (*onCustomChannelPasswordCheck)(uint64 serverID, const struct ClientMiniExport *client, uint64 channelID, const char *password)

called when a client attempts to enter a password protected channel. Used to verify the channel password when using custom password encryption.

Param serverID:

the server for which the callback was called

Param client:

describes the client that enters a channel

Param channelID:

the channel the client attempts to join

Param password:

utf8 encoded c string containing the password provided by the client.

Return:

a value from the Ts3ErrorType enum. ERROR_ok if the password is valid, ERROR_server_invalid_password if the password is not valid, ERROR_parameter_invalid if the password is in invalid format.