Create a one-way token for the user sign-in
With the entered string, which is called a token, the method createToken creates a single-use token that entitles the entered user to sign into JobRouter.
The entered token needs to be at least 32 and at most 50 characters long. Per request the validity of the token can be set to a period between 0 and 3600 seconds. Per default the validation period of the token is 60 seconds.
In case the request is successful, it returns the boolean value true. During the validity period, this token can then be used once by the user to sign into JobRouter.
In case the requested user does not exist, the token length is insufficient or the entered validity period is invalid, an error message will be returned.
Method reference
Parameters |
Data type |
Description |
|---|---|---|
token |
Unique login token (32 to 50 characters) |
|
userName |
Username |
|
lifetime |
Validity period of the token in seconds |
Return value: bool; true, if the login token was created successfully, otherwise false