Getting a 401 Unauthorised error when pressing submit on Login Form

I’ve created a login for following the steps in the documentation. Unauthorised works fine but when I try to login user confirmed user details contained within my “user” database table nothing happens.
I’ve tried debugging in Chrome/dev tools and there is an error line (see attached grab) - can anyone suggest a cure please?

Please follow the below procedure to activate error reporting and activate a more accurate error message.

I’ve followed the instructions to the letter and noticed that when I select the form and click the button to make it a server connect form the name of the form doesn’t change to server connect form 1 as it does in the documentation (see attached video).

I’ve also attached a video showing the results of my debut.Screen Recording 2019-05-22 at 11.43.26.mov (12.2 MB)
Screen Recording 2019-05-22 at 11.35.26.mov (59.3 MB)

Yes, there is a sync problem with the app connect screen at times but don’t worry, if you check the coder view the form has been changed to a server connect form, it’s just a window sync issue in the current beta release @george tagged for your info re bug

Also you missed the dot between www and google.com, you entered http://wwwgoogle.com

Not entirely sure what you are trying to show here and where in the video, can you explain please

If you follow the instructions about debugging above you will get more proper diagnostic information, please do that

Thanks

I just put google in to show that authentication success takes me to a different page. I’ve put another URL in that directs to my app index page.
The problem is that when I enter credentials that do exist in the database I get the “unauthorised” message instead of the redirected page.
I will go through the debug tutorial and post more information.

I’ve followed the debug tutorial and identified the file causing the error - index.php

Here is the content:

  1. Request URL:

http://www.bandsuite.net/dmxConnect/api/data/security/login.php

  1. Request Method:

POST

  1. Status Code:

401 Unauthorized

  1. Remote Address:

77.104.129.251:80

  1. Referrer Policy:

no-referrer-when-downgrade

  1. Response Headersview source

  2. Cache-Control:

no-store, no-cache, must-revalidate, post-check=0, pre-check=0

  1. Connection:

keep-alive

  1. Content-Type:

; charset=utf-8

  1. Date:

Wed, 22 May 2019 12:26:32 GMT

  1. Expires:

Thu, 19 Nov 1981 08:52:00 GMT

  1. Host-Header:

192fc2e7e50945beb8231a492d6a8024

  1. Pragma:

no-cache

  1. Server:

nginx

  1. Transfer-Encoding:

chunked

  1. X-Generator:

DMXzone Server Connect

  1. Request Headersview source

  2. Accept:

3./*

  1. Accept-Encoding:

gzip, deflate

  1. Accept-Language:

en-GB,en;q=0.9

  1. Connection:

keep-alive

  1. Content-Length:

254

  1. Content-Type:

multipart/form-data; boundary=----WebKitFormBoundarykVkpno2VZhckMO5d

  1. Cookie:

PHPSESSID=3qbuu4batea8dv7dpdg504qik6

  1. Host:

www.bandsuite.net

  1. Origin:

http://www.bandsuite.net

  1. Referer:

http://www.bandsuite.net/APP/login.html

  1. User-Agent:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36

  1. Form Dataview sourceview URL encoded

  2. username:

noelfraser

  1. password:

SarahBeth4

Please post a screenshot of the error in the response of XHR tab exactly as shown in the tutorial…

I contacted my isp to see if there were any settings on my account that might be causing a problem and I got this message which may be useful:

Hello Noel,

The credentials provided trigger a 401 due to being incorrect. Furthermore, there appear to be some syntax issues with your login script that might hinder the ability for a user to authenticate:

Code:

Error: “Lexer Error: Unexpected token ‘W’ at column 17 in expression [browser1.alert(”“Wrong User Details”)]"

I would advise revising your code and adjusting it. There appear to be foreign and white-space characters in the following file:

Code:

/home/noelfras/public_html/bandsuite.net/dmxConnect/api/data/security/login.php

Please click the server action with the error and open RESPONSE (just as in the tutorial please).
We need this:

I’ve done this and posted the 2 screenshots in an earlier reply - I’ve also copy and pasted the header content into a reply to make it easier to read

No you have not done this, You need to click on PREVIEW or RESPONSE to see the exact error message. This is pretty well explained in our tutorial and i really thought it’s as detailed as possible …

Apologies - I missed that step

Ok it seems the issues is indeed the security provider finds your login credentials wrong.

Can you send me a screenshot of what do you have in the security provider step and another one showing all steps in your server action?

The second video 11:35:26 shows the whole process - there are some pauses where I refer to the documentation

1 Like

Ah yes, sorry I missed that. I will check your videos now.

Should I post screen shots of my db table setup?