Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1145
  • Last Modified:

TWebBrowser authentication

Hi All,
 i am usign TWebBrowser to embed a browser in my form. From the TWebBrowser i call Navigate2() method to navigate to a url. Before the URL opens, a dialog is displayed to get the userid and password from the user.
 is there any way i can pass the information from the browser to the server without interrupting the user with the message box..
Appreciate the help.
Thanks,
Preetham.
0
kingpreetham
Asked:
kingpreetham
  • 4
1 Solution
 
lnishimuraCommented:
u can call the url like this

http://username:password@Your_urlAddress
0
 
lnishimuraCommented:
Here is a code
Put 2 edit's (User,Pass) and 1 button

----------------Sample---------------------
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, OleCtrls, SHDocVw_TLB;

type
  TForm1 = class(TForm)
    WebBrowser_V11: TWebBrowser_V1;
    Button1: TButton;
    user: TEdit;
    pass: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser_V11.Navigate('http://' + user.text +':' + pass.text + '@192.168.0.254');
end;

end.





0
 
kingpreethamAuthor Commented:
I did pass the uid:pwd in the url and it worked...
How can i pass it as a part of the authentication header...
does it make a difference as compared to the first method..
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
lnishimuraCommented:
I dont know...
But i think its not different than the first one
0
 
lnishimuraCommented:
wont you close this?
0
 
moduloCommented:
PAQed with points refunded (50)

modulo
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now