Page 1 of 1

Cant send login-dtata for Webmail-APP SOGo

Posted: Tue Dec 22, 2020 12:24 pm
by agmberlau
Hello,

i tried to send login-data to a webmailapplication, the name is SOGo.
In developerconsole of chrome i fround the url to login:

Request URL: https://mail.domainname.com/SOGo/connect
{userName: "mb@domainname.com", password: "verysecret", rememberLogin: 1}
password: "verysecret"
rememberLogin: 1
userName: "mb@domainname.com"

And when i try this delphi-code:

Code: Select all

procedure TChildForm.Button2Click(Sender: TObject);
var
  Header: ICefStringMultimap;
  Data: ICefPostData;
  Request: ICefRequest;
begin
  Request := TCefRequestRef.New;
  Request.Url := 'https://mail.domainname.com/SOGo/connect';
  Request.Method := 'POST';
  Request.Flags := UR_FLAG_NONE;

  Header := TCefStringMultimapOwn.Create;
  Header.Append('Content-Type', 'application/x-www-form-urlencoded');
  Request.SetHeaderMap(Header);

  Data := TCefPostDataRef.New;
  Data.AddElement(CreateField('userName=mb@domainname.com'));
  Data.AddElement(CreateField('&password=verysecret'));
  Data.AddElement(CreateField('&rememberLogin=1'));
  Request.PostData := Data;
  Chromium1.LoadRequest(Request);

end;
i get this errormessage in the chromium browser:

Code: Select all

{"LDAPPasswordPolicyError": 65535}
can anyone help me to solve this problem?

greetings
marc

Re: Cant send login-dtata for Webmail-APP SOGo

Posted: Tue Dec 22, 2020 1:40 pm
by salvadordf
Hi,

I don't know that service but I would try to add only one element with the whole query to "Data".

Code: Select all

  Data.AddElement(CreateField('userName=mb@domainname.com&password=verysecret&rememberLogin=1'));
Please read the code comments in uCEFChromiumCore.pas about the TChromiumCore.LoadRequest function. It may be problematic if you don't navigate to that domain previously.

Re: Cant send login-dtata for Webmail-APP SOGo

Posted: Tue Dec 22, 2020 2:51 pm
by agmberlau
Thank you for your response.
But to send the data in one line doesnt work, the error is the same.
The url is allready loaded, the login screen is visible, but i cant post then login data to a working result.

Re: Cant send login-dtata for Webmail-APP SOGo

Posted: Tue Dec 22, 2020 3:37 pm
by salvadordf
Then I would suggest that you compare your code to other projects that connect to that service.

Perhaps you need to add a special HTTP header, cookie, query parameter, etc...

Inspecting the HTTPS traffic would also be helpful.

Re: Cant send login-dtata for Webmail-APP SOGo

Posted: Wed Dec 23, 2020 12:04 pm
by agmberlau
In conclusion, I have found a way.
First a php script is called with the necessary POST variables and that starts a javascript which in turn starts the login process.

Thanks for your help and of course for the sensational unit to drive Chromium.