Login

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
Pierp
Registered User
Posts: 12
Joined: Sat Apr 04, 2020 7:37 am

Login

Post by Pierp »

Hi

I have tried to build my code in order to login Pierp account ( I hope this doesnt break the rules, if it does I will try in local).

I'm able to get cookies and session ID over https :

Code: Select all

	out.write("POST https://www.phpbb.com/community/ucp.php?mode=login HTTP/1.1\r\n");
        out.write("Host: www.phpbb.com\r\n");
        out.write("User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 	 Edge/12.246\r\n");
        out.write("Accept: text/html\r\n");
        out.write("Accept-Language: en-US,en;q=0.5\r\n");
        out.write("Content-Type: application/x-www-form-urlencoded\r\n");
        out.write("Content-Length: 49\r\n");
        out.write("\r\n");
        out.write("username=Pierp&password=123456789012&autologin=on\r\n");
//The server send cookies and I exctrat them. Example:
//phpbb3_1dh61_u=1; phpbb3_1dh61_k=; phpbb3_1fh61_sid=15a7632b33e274bdfe22vbeg7a4f7fbc;

// By GET I try to complete the login request:

Code: Select all

	cookies = extractCokiesFromResponse();
        out.write("\r\n");
        out.write("GET https://www.phpbb.com/community/index.php HTTP/1.1\r\n");
        out.write("Host: www.phpbb.com\r\n");
        out.write("\r\n");
        out.write("Cookie: " + cookies + "\r\n");
but the server return a 401 bad request. May I ask to check my code pls ?
I suspect an error in the extract cookies function but I would like know if there are one or more errors on the http header
Thanks so much
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 26257
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Login

Post by Paul »

You should not develop something on someone else's production site ;). Just install a copy of phpBB locally and work on that. That also makes it easier as you will be able to see log files, which will show you maybe what is going wrong.

You probarbly want to check the actual status of what is returned, and check if the login is actually succeeded instead of just assuming it is fine.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development
Pierp
Registered User
Posts: 12
Joined: Sat Apr 04, 2020 7:37 am

Re: Login

Post by Pierp »

Thanks I will install phpBB on the vps
Post Reply

Return to “phpBB Custom Coding”