The TeamSpeak SDK has the optional ability to do custom password handling. This allows the possibility to check TeamSpeak server and channel passwords against an outside datasources, like LDAP or other databases.
To implement custom password, 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.
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 are 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.
void onClientPasswordEncrypt( | serverID, | |
plaintext, | ||
encryptedText, | ||
encryptedTextByteSize) ; |
uint64 serverID
;const char* plaintext
;char* encryptedText
;int encryptedTextByteSize
;serverID
ID of the server the password call occured
plaintext
The plaintext password
encryptedText
Fill with your custom encrypted password. Must be a 0-terminated string with a size not larger than encryptedTextByteSize
.
encryptedTextByteSize
Size of the buffer pointed to by encryptedText
.
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 if performed, even if no password is set.
unsigned int onCustomServerPasswordCheck( | serverID, | |
client, | ||
password) ; |
uint64 serverID
;const struct ClientMiniExport* client
;const char* password
;
serverID
ID of the server on which a client password is checked when the client connects to this server
client
Identifies the connecting client
password
Password the client is using. This parameter is an empty string ("") if no password is set.
The function should return ERROR_ok
if the password is verified, ERROR_server_invalid_password
if not verified or ERROR_invalid_param
if the password is in an invalid form.
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 if performed, even if no password is set.
unsigned int onCustomChannelPasswordCheck( | serverID, | |
client, | ||
password) ; |
uint64 serverID
;const struct ClientMiniExport* client
;const char* password
;
serverID
ID of the server on which a client password is checked when the client enters a password-protected channel
client
Identifies the client
password
Password the client is using. This parameter is an empty string ("") if no password is set.
The function should return ERROR_ok
if the password is verified, ERROR_server_invalid_password
if not verified or ERROR_invalid_param
if the password is in an invalid form.