liuch / dmarc-srg

A php parser, viewer and summary report generator for incoming DMARC reports.
GNU General Public License v3.0
213 stars 31 forks source link

Cant login #115

Closed AlexPBrin closed 6 months ago

AlexPBrin commented 6 months ago

changed the password and still doesn't work

liuch commented 6 months ago

Did you copy the config/conf.sample.php file to config/conf.php? If so, could you show the part of your config file with the lines where you changed the password? Replace your password with something else like ***.

AlexPBrin commented 6 months ago

yes it's on config/conf.php

Screenshot 2024-01-18 153638 Screenshot 2024-01-18 1537501

AlexPBrin commented 6 months ago

I ran inspect and login.php returns 400 (bad request)

liuch commented 6 months ago

What webserver are you using?

AlexPBrin commented 6 months ago

https://www.inmotionhosting.com, CPANEL

andrewhenke commented 6 months ago

I am also having this issue @liuch . I did some digging and it looks like the default handler in the login.php code is to return a HTTP 400 bad request message if the HTTP request type is not an HTTP GET request -- and, of course, the login credentials are sent via HTTP POST. Currently I see the POST request to login.php returns a HTTP 400 code with the body "bad request" when the login request is made.

https://github.com/liuch/dmarc-srg/blob/41eb96c8f05d8cc4dafdb39df78e806fee512a13/public/index.php#L25-L32

Could this be a cause of this?

My hosting environment is a LAMP server with internally distributed MySQL database on a separate location, which has never given me issues.

liuch commented 6 months ago

Nginx, I suppose. Could you see what type of request the browser is sending and the value of the http header Accept. They must be 'POST' and 'application/json'.

andrewhenke commented 6 months ago

@liuch please see the below screenshot, and also note that my server runs Apache with PHP 8.1 It seems that the necessary browser requirements are being met -- could I provide any additional information?

Screenshot 2024-01-18 172230
liuch commented 6 months ago

@andrewhenke What if you exclude the lastest commit? I think it causes the issue. Could you check that?

andrewhenke commented 6 months ago

@andrewhenke What if you exclude the lastest commit? I think it causes the issue. Could you check that?

@liuch I tried that, and it didn't work for me. Could you please reference the commit hash I should revert to, and test with, so I can attempt this and make sure that we are speaking of the same commit?

liuch commented 6 months ago

This one: https://github.com/liuch/dmarc-srg/commit/41eb96c8f05d8cc4dafdb39df78e806fee512a13 And could you tell me which version you were using before the problem appeared.

andrewhenke commented 6 months ago

Let me give it a try, and I was using the latest version of the code you released for the S3 integration, and it was perfectly fine for weeks. I don't entirely remember if I updated the code or not again after that, but it essentially overnight stopped working, and I don't have automatic git pulls set up for this repository.

I'll update you in a moment on the status of testing with the referenced commit.

liuch commented 6 months ago

Thank you a lot.

andrewhenke commented 6 months ago

@liuch I just tried this commit and it also did not work. Same error.

liuch commented 6 months ago

@andrewhenke What is strange. Did I understand you correctly and you are using apache2 as a web server? Thank you again.

andrewhenke commented 6 months ago

@liuch that is correct, I'm using Apache webserver with PHP 8.1. Is there any additional information I can provide for you?

liuch commented 6 months ago

That is enough. I'll try to create a similar configuration. Thank you.

liuch commented 6 months ago

Fixed with https://github.com/liuch/dmarc-srg/commit/f8ded32c3c0a98741659147db1202ce42ea5f0d5.

AlexPBrin commented 6 months ago

TYVM

liuch commented 6 months ago

YW