class
PasswordUtil
Helper class for logging in with a pre-hashed password.
This is needed if your server-side database stores User passwords hashed with MD5.
For more information see the Sign Up Assistant component tutorial (Password Mode section).
Method
new PasswordUtil()
Developers never istantiate the PasswordUtil class: only use its static properties.
Method
static
md5Password(pass) → string
Generates the MD5 hash of a user password.
Example
This example performs a login with an hashed password:
function doLogin()
{
var userName = "testName";
var userPass = "testPass";
var md5Pass = SFS2X.PasswordUtil.md5Password(userPass);
sfs.send(new SFS2X.LoginRequest(userName, md5Pass, null, sfs.config.zone));
}
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
pass |
string |
|
The plain text password. |
- Returns
-
stringThe hashed password.