Zentitle SDK and Library
1139

Invalid username or password for login

When using Account Based Licensing, the entered authentication details are stored in the license file in the WorkDir.

If the application is closed and then started again, a call to NSLCheckCredentials() fails with return value -1139.

Solution

Credentials entered into the library must be verified against the credentials stored in the license. This is done with a call to NSLSetCredentials(), followed by a call NSLCheckCredentials(). The following is from the documentation at html/index.html in the codekits:

int NSLCheckCredentials ( )

Validate credentials passed into the library with NSLSetCredentials against any stored in the license file. When a program with an ABL license has been shutdown without a ReturnLicense() call, the credentials are cached in the license file. Once the library is restarted, before the license file's entitlements can be accessed, those credentials must be verified. This state is indicated by a -70 license status. The verification is done using this call.

If the cached credentials are a username/password combination that was initially validated by the Nalpeiron server then the username and password passed to NSLSetCredentials() will be validated against those stored in the license file. NOTE the password is never stored or transmitted in plain text. If the cached credentials were initially verified by a callback function then that callback will be called to verify the password and username passed to NSLSetCredentials.

If the cache credentials were initially verified by a callback with authentication token then that token will need to be passed back to the library from the callback function. The username and token will be verified against those stored in the license file.

Returns= 0 If the call succeeded < 0 A negative error value is returned.

Summary: Before using an ABL license file that contains credentials, you must first call NSLSetCredentials() to supply to the library the credentials. After this is done, you call NSLCheckCredentials to validate those credentials against the ones in the license.

Error Codes