pixiCheckPixiUserLogin
Checks a Pixi user name and password, optionally a permission code, and returns whether the login is valid together with the user's e-mail and real name.
Validates the credentials of a Pixi user (table UCS_USERS).
- The password is passed through
dbo.PixiEncrypt. The stored passwordUSER_PWDis compared with this encrypted value. - The user is looked up by
UserName. If the user'sUSER_PWDisNULL, the procedure uses version 2 password validation and callspixi.UserPassword_ValidateV2with user name and plain password. If that procedure reports success, the password check counts as passed. ValidUseris1only if a user with the givenUserNameexists and all of these conditions are met:- the password matches, either by the classic comparison or by the V2 validation;
- if
CheckPermissionis set, the user has a role (USER_HAS_ROLES→USER_ROLES→ROLE_HAS_PERMISSIONS) that grants a permission whosePermission_CodeequalsCheckPermission. An empty string counts as "no permission check"; - the account has not expired:
User_expireis not1, or it is1andExpiration_dateis later than the current time; User_active = 1. OtherwiseValidUseris0.
- If the login is valid, the output parameters
UserEmailandUserRealNameare filled fromUser_EmailandREAL_NAME.NULLvalues become empty strings. - Unless
SuppressDataset = 1, the procedure returns one row withValidUser,UserName,UserEmailandUserRealName.
Notes
- The returned row contains
UserEmailandUserRealNamewhenever the user name exists, even ifValidUseris 0, for example after a wrong password. If the user does not exist, both columns areNULL. The output parametersUserEmail/UserRealName, by contrast, are set only on a valid login. dbo.PixiEncryptis only a simple XOR obfuscation, not a cryptographic hash. Send the password only over the encrypted connection.pixi.UserPassword_ValidateV2is not attached. Its exact logic and any side effects, such as logging or lockout, are unknown.- If
User_expireisNULL, the expiry condition does not evaluate to true, so such users are rejected. - The comparison of the user name depends on the database collation. The initial V2 lookup uses
COLLATE DATABASE_DEFAULT, the validity check does not. - All reads in the validity check use
NOLOCK.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
UserName
Required
|
varchar(1024) string |
– |
Pixi user name ( Example: |
Password
Required
|
varchar(1024) string |
– |
Plain-text password of the user. Example: |
CheckPermission
|
varchar(5) string |
NULL |
Optional permission code ( Example: |
ValidUser
OUTPUT
|
bit boolean |
NULL |
Output: |
SuppressDataset
|
bit boolean |
NULL |
If Allowed values
Example: |
UserEmail
OUTPUT
|
varchar(100) string |
NULL |
Output: the user's e-mail address, set only if the login is valid. An empty string if none is stored. |
UserRealName
OUTPUT
|
varchar(40) string |
NULL |
Output: the user's real name, set only if the login is valid. An empty string if none is stored. |
Response
Result set 1 · If SuppressDataset is not 1.
One row with the result of the login check.
| Column | Type | Description |
|---|---|---|
ValidUser
|
bit boolean |
|
UserName
|
varchar(1024) string |
The user name as passed in. |
UserEmail
Nullable |
string |
E-mail address from |
UserRealName
Nullable |
string |
Real name from |
Response example
<SqlRowSet1>
<row>
<ValidUser>true</ValidUser>
<UserName>shopapi</UserName>
<UserEmail>shopapi@example.com</UserEmail>
<UserRealName>Shop Schnittstelle</UserRealName>
</row>
</SqlRowSet1>
Examples
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
Authorization: Basic BASE64(USERNAME:PASSWORD)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiCheckPixiUserLogin>
<UserName>shopapi</UserName>
<Password>S3cret!2024</Password>
<!-- <CheckPermission>API</CheckPermission> -->
<!-- <ValidUser>?</ValidUser> -->
<!-- <SuppressDataset>0</SuppressDataset> -->
<!-- <UserEmail>?</UserEmail> -->
<!-- <UserRealName>?</UserRealName> -->
</ns1:pixiCheckPixiUserLogin>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
curl -X POST 'https://apigateway.descartes.com/tms/pixi/' \
--user 'USERNAME:PASSWORD' \
--header 'Content-Type: text/xml; charset=utf-8' \
--data-binary @- <<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiCheckPixiUserLogin>
<UserName>shopapi</UserName>
<Password>S3cret!2024</Password>
<!-- <CheckPermission>API</CheckPermission> -->
<!-- <ValidUser>?</ValidUser> -->
<!-- <SuppressDataset>0</SuppressDataset> -->
<!-- <UserEmail>?</UserEmail> -->
<!-- <UserRealName>?</UserRealName> -->
</ns1:pixiCheckPixiUserLogin>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML
<?php
$soapClient = new SoapClient(null, [
'login' => 'USERNAME',
'password' => 'PASSWORD',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
]);
$arguments = [
'UserName' => 'shopapi',
'Password' => 'S3cret!2024',
// 'CheckPermission' => 'API',
// 'ValidUser' => '?',
// 'SuppressDataset' => '0',
// 'UserEmail' => '?',
// 'UserRealName' => '?',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiCheckPixiUserLogin', $soapArguments);
Tables used
- SQL object:
- dbo.pipiCheckPixiUserLogin