Login failed. Insufficient privileges.

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
mka.surveys
Posts: 6
Joined: July 18th, 2017, 4:06 pm

Login failed. Insufficient privileges.

Post by mka.surveys »

Hi everyone,

I just finished setting up CSWeb server. I got the "Setup Complete!" message and was redirected to the app login page http://mydomain.com/csweb/ui but I can't manage to login.

I'm following the instructions on http://www.csprousers.org/help/CSWeb/ap ... setup.html so I try to login as user "admin" and using the password I typed in the setup.

I already tried deleting the config files and re-doing the process, but I get the same error. Inside the logs/ui.log file I see:


[2017-07-18 21:19:50] CSPro UI.INFO: Matched route "GET_". {"route_parameters":{"_controller":"Controllers\\LoginController::login","_route":"GET_"},"request_uri":"http://mydomain.com/csweb/ui/"} []
[2017-07-18 21:19:53] CSPro UI.INFO: Matched route "login_check". {"route_parameters":{"_controller":"Controllers\\LoginController::loginAction","_route":"login_check"},"request_uri":"http://mydomain.com/csweb/ui/login_check"} []


Thanks
Attachments
login.png
login.png (8.55 KiB) Viewed 9515 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Login failed. Insufficient privileges.

Post by josh »

Do you see anything in the api.log file?
mka.surveys
Posts: 6
Joined: July 18th, 2017, 4:06 pm

Re: Login failed. Insufficient privileges.

Post by mka.surveys »

I don't have the api.log file, and the info in ui.log is not very useful. What else can I do?

Thank you josh!
tpr
Posts: 4
Joined: July 18th, 2017, 1:37 pm

Re: Login failed. Insufficient privileges.

Post by tpr »

I'm also getting the "Insufficient Privileges" error on a new csweb server when I log in as a regular user. I'm able to log in as admin with no problem. I have an api.log file. Anything in particular I should look for?

ETA: here's part of the log.

[2017-07-18 15:22:57] CSPro API.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /csweb/api" (uncaught exception) at C:\inetpub\wwwroot\csweb\vendor\symfony\http-kernel\EventListener\RouterListener.php line 176 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /csweb/api\" at C:\\inetpub\\wwwroot\\csweb\\vendor\\symfony\\http-kernel\\EventListener\\RouterListener.php:176, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0): No routes found for \"/csweb/api\". at C:\\inetpub\\wwwroot\\csweb\\vendor\\symfony\\routing\\Matcher\\UrlMatcher.php:98)"} []

Another update:
I don't think that log actually shows the error. It isn't updated when I get the failed login. The ui log is updated when I log in, but it doesn't look like there's anything helpful here.

[2017-07-19 16:33:14] CSPro UI.INFO: Matched route "login_check". {"route_parameters":{"_controller":"Controllers\\LoginController::loginAction","_route":"login_check"},"request_uri":"https://cpc-fs1.ad.unc.edu/csweb/ui/login_check"} []


Thanks.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Login failed. Insufficient privileges.

Post by josh »

@tpr Regular users can't log in to the web interface. Only admin users can login to the web interface. The idea is that a regular user is what you use for your interviewer tablets to send data to the server but they can't use the web interface. Only an admin user can use the web interface.

@mka.surveys if you don't have an api.log file then there is probably something wrong with the configuration. To get more detailed info in the ui.log file try changing the line:

Code: Select all

$logLevel = Monolog\Logger::ERROR;
to

Code: Select all

$logLevel = Monolog\Logger::DEBUG;
in the file csweb\src\ui\src\app.php and then try to log in again and post what you see in the ui.log.
tpr
Posts: 4
Joined: July 18th, 2017, 1:37 pm

Re: Login failed. Insufficient privileges.

Post by tpr »

Ah, ok. Thanks, Josh.
mka.surveys
Posts: 6
Joined: July 18th, 2017, 4:06 pm

Re: Login failed. Insufficient privileges.

Post by mka.surveys »

Thanks Josh,

The particular line you mention is missing in app.php. Are the following lines equivalent? If so, the debug mode is already active :| .

Code: Select all

$app->register(new Silex\Provider\MonologServiceProvider(), array(
    'monolog.logfile' => __DIR__.'/../../../logs/ui.log',
	'monolog.name' => 'CSPro UI',
	'monolog.level'=> Monolog\Logger::DEBUG
));
I guess I'm running out of options, so I'll be willing to give you access to my server if you could help me.

Again, thanks Josh!
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Login failed. Insufficient privileges.

Post by josh »

Yes, that should be the same. Please email or PM credentials to the server and I'll take a look.
savy
Posts: 159
Joined: December 27th, 2012, 1:36 pm

Re: Login failed. Insufficient privileges.

Post by savy »

If CSWeb is running under apache with fastcgi then the authorization headers are possibly being removed causing this issue.
In this case, add this line to .htaccess located in csweb folder

SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
Jeevan
Posts: 1
Joined: April 2nd, 2020, 4:13 am

Re: Login failed. Insufficient privileges.

Post by Jeevan »

Thank you it work :) :)
Post Reply