Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Cant send login-dtata for Webmail-APP SOGo

Post Reply
agmberlau
Posts: 3
Joined: Tue Dec 22, 2020 12:12 pm

Cant send login-dtata for Webmail-APP SOGo

Post 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
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

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

Post 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.
agmberlau
Posts: 3
Joined: Tue Dec 22, 2020 12:12 pm

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

Post 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.
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

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

Post 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.
agmberlau
Posts: 3
Joined: Tue Dec 22, 2020 12:12 pm

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

Post 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.
Post Reply