HEX
Server: LiteSpeed
System: Linux d8 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: wbwebdes (3015)
PHP: 8.1.31
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/wbwebdes/domains/survey.wb-webdesign.com/public_html/application/config/rest/v1/auth.php
<?php

use LimeSurvey\Api\Command\V1\{
    AuthSessionCreate,
    AuthTokenSimpleCreate,
    AuthTokenSimpleRefresh,
    AuthTokenSimpleRelease
};
use LimeSurvey\Api\Rest\V1\SchemaFactory\{
    SchemaFactoryError,
    SchemaFactoryAuthToken
};

$errorSchema = (new SchemaFactoryError)->make();

$rest = [];

$rest['v1/auth'] = [
    'POST' => [
        'description' => 'Generate new authentication token',
        'commandClass' => AuthTokenSimpleCreate::class,
        'params' => [
            'username' => ['src' => 'form'],
            'password' => ['src' => 'form']
        ],
        'bodyParams' => [],
        'responses' => [
            'success' => [
                'code' => 200,
                'description' => 'Success - returns string access token for use in header '
                    . '"Authorization: Bearer $token"',
                'schema' => (new SchemaFactoryAuthToken)->make()
            ],
            'unauthorized' => [
                'code' => 401,
                'description' => 'Unauthorized',
                'schema' => $errorSchema
            ]
        ]
    ],
    'PUT' => [
        'description' => 'Refresh authentication token',
        'commandClass' => AuthTokenSimpleRefresh::class,
        'auth' => true,
        'params' => [],
        'bodyParams' => [],
        'responses' => [
            'success' => [
                'code' => 200,
                'description' => 'Success - returns string access token for use in header '
                . '"Authorization: Bearer $token"',
                'schema' => (new SchemaFactoryAuthToken)->make()
            ],
            'unauthorized' => [
                'code' => 401,
                'description' => 'Unauthorized',
                'schema' => $errorSchema
            ]
        ]
    ],
    'DELETE' => [
        'description' => 'Destroy currently used authentication token',
        'commandClass' => AuthTokenSimpleRelease::class,
        'auth' => true,
        'params' => [],
        'bodyParams' => [],
        'responses' => [
            'success' => [
                'code' => 200,
                'description' => 'Success',
            ],
            'unauthorized' => [
                'code' => 403,
                'description' => 'Forbidden',
                'schema' => $errorSchema
            ]
        ]
    ]
];

// Add session endpoints to auth endpoints for backward compatibility
// - can remove this once the survey template functionality is calling
// - /auth instead of /session
$rest['v1/session'] = $rest['v1/auth'];
$rest['v1/session']['POST']['commandClass'] = AuthSessionCreate::class;

return $rest;