Android Code Snippet Register User example using OkHttpUtils2

Hedgar

Member
Hi. Thanks For This Example. how comes the password is not case sensitive and how can we fix this.
as in i tried login in the the same password but different cases. surprisingly, all of them work
 

aeric

Expert
Licensed User
Longtime User
Hi. Thanks For This Example. how comes the password is not case sensitive and how can we fix this.
as in i tried login in the the same password but different cases. surprisingly, all of them work
I never tested on the password case. Maybe you can find on Internet how to handle the case incensitive.
 

toby

Well-Known Member
Licensed User
Longtime User

Great tutorial indeed! My current app is similar to your tutorial in that the database login username/password are stored on the server in php file. Now I need to make it more secure to prevent from unauthorized access to mysql database. Anyone could access a url like https://mywebsite.com/updateCustomer. How do I make sure that the request is from my b4a app and nothing else?

Thank you in advance for your help!
 

aeric

Expert
Licensed User
Longtime User
Check my latest example where I use API key.
 

CyberDroidWare

Member
Licensed User
Good work. I know this is a demo but just to help other developers, you do need to consider Cybersecurity and privacy when using any Web call in your App. Be sure to use properly configured HTTP pinning secure connection to avoid both breaches and/or MITM interception/hacking.

Simon

MITM attack reveals plain text details:
GET /b4a/register-user-php/connect.php HTTP/1.1
Host: demo.computerise.my
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.5.0

HTTP/1.1 200 OK
Date: Sat, 21 Nov 2020 07:12:49 GMT
Server: Apache
X-Powered-By: PHP/7.2.34
Upgrade: h2,h2c
Connection: Upgrade, Keep-Alive
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=100
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

b
"Connected"
0

GET /b4a/register-user-php/signin.php?user_id=122&password=eee HTTP/1.1
Host: demo.computerise.my
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.5.0
 

aeric

Expert
Licensed User
Longtime User
I agree with you that security need to be considered. If you read from the start, you will notice that when I posted this project, I was just started with B4A, Httputils and PHP back to 5 years ago. That’s why I recommended to take a look of my latest project in post #84.
 

softmicro

Member
Licensed User
Longtime User
Hello,
I have tested your application version 1.3 and it works correctly with your external address for the registration of a new user when sending the email, and confirm there with the confirmation link.
But I do not achieve the same with the application on my local server, although the rest works, because I do not know what email address you have to put in order to send the request and access the new user authorization link.
Can you help me to achieve the goal of local use?
Is it possible to use this option in this condition?

I'm using google translate, sorry if the translation is not correct.
Thanks
 

softmicro

Member
Licensed User
Longtime User
Hello Aeric
I am on my PC and I have opened XAMPP for Apache and phpmyadmin.
I have also used Visual Studio to analyze and edit the PHP.

I have even edited both PHP and B4A to my language and all the functions that do not include the sending of confirmation email work correctly.
I cannot understand how the recipient email data should be completed in this internal use case.
Later, I will find out how to do all this from my server at Hostgator.
Thanks
 

aeric

Expert
Licensed User
Longtime User
I am not sure how it is done using XAMPP but using Laragon is easy to test the email function. It can also create the email as txt file inside a mail folder.
 

softmicro

Member
Licensed User
Longtime User
Hi
Excellent use of the laragon application instead of xampp to send the mail needed to register a new user or act on the password.
I also added that it allows access to unsafe applications in the security property in the gmail account that I had used for this occasion.
Thank you very much for your advice.

Additional topic, on Friday August 13, I have sent you the completed form to your COMPUTERISE page to get in touch with you to request the provision of different software that you offer.

But I have not received any response or acceptance of my submission.
Will I have to resubmit my contact request?
Thanks
 

aeric

Expert
Licensed User
Longtime User
Not sure it went to junk folder. You can send me a private message.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…