Hello everyone, my name is Guillaume, i'm french (so sorry for my bad englich) and I'm new on B4J.
I try using MQTTBrokerExtended library exemple.
The broker demo autorizationdemo.
But i always get this error:
13/04/2022 10:43:11.680 ERROR Error processing protocol message: CONNECT
13/04/2022 10:43:11.680 INFO Closed client channel due to exception in processing
Thanks, it work better when i modify some line in the programme.(direct return true)
But i'am not shure of encoded format in the password file.
I have test with base64, md5 and sha256, all this format seems to be wrong?
Witch encoded format is it ?
Dim MD5() As Byte = MD.GetMessageDigest(Password, "MD5")
Dim StoredMD5 As String = PasswordMap.Get(Username)
Return (B64.EncodeBtoS(MD5, 0, MD5.Length) = StoredMD5)
I can say that the password file format is Map containing values of MD5 hashes (as byte arrays) encoded to base64 strings.
Use this code to generate your values for passwords file:
B4X:
Dim pstring As String = "1234" 'Change this to your password string
Dim pbytes() As Byte = pstring.GetBytes("UTF8")
Dim pMD5() As Byte = MD.GetMessageDigest(pbytes, "MD5")
Dim pFileValue As String = B64.EncodeBtoS(pMD5, 0, pMD5.Length)
Log(pFileValue)