External chat system

Dominik L Posted in Technical Support 2 years ago

Hello!

I created a chat system in PHP and Javascript, it's not integrated as a component, but as a seperate system in a seperate folder - it connects to my existing MySQL Database to retrieve the user data of already existing users, so they can chat with their normal account.

I implemented, that the script connects to database and get the guid, username and the hashed password from database and then using "password_verify" function to verify the plain text password from user input with the encrypted password from database.

Then I use

 Debug: Print password and password hash
echo "<br>Password: $password<br>Password hash: $password_hash";

to print the output to make sure the password is retrieved successfully from database.

The password and username are retrieved successfully, the hash and the plain password are matching the database user and password, but I still get "Invalid username and password"

I already tried to change the password to a new one without any special characters, just using numbers and letters, but it is still not working.

Can someone help?

Replies
German Michael Zülsdorff Replied 2 years ago

Thanks for sharing, Rafael!
Working fine for me using Ossn 6.5 plus OssnServices 8.4

Actually, not out of the box on my local machine :)
After changing echo 'Failed to connect to API endpoint';
to echo curl_error($curl);
I got SSL certificate problem: certificate has expired

Yes, yes, it's because of my self-signed certificate...
For good reasons curl is picky about things like that,
but for just testing you may force curl to ignore the invalid certificate with this extra option

CURLOPT_SSL_VERIFYPEER => false,
Breton Rafael [redcrested.net] Replied 2 years ago

I tried to put the code here, but it's not allowed. So I sent to https://paiza.io/projects/x_OSJgLBpIutQFjuGERBRg

Fun fact: As a test, part of this code is created by ChatGPT. This tool has a lot of potential.

German Dominik L Replied 2 years ago

@rafael, I sent you a mail about that