Basic Authrntification

Add-in Express™ Support Service
That's what is more important than anything else

Basic Authrntification
neew to pass Cookies Header "Authentification: jklsdhksdhkjsdfghkjdfhkdgsfjhkgdjhgkfhgdjhdgd=" 
Jack Nerman




Posts: 15
Joined: 2011-06-17
Hi

How to I modify "BeforeNavigate2(ADXIEBeforeNavigate2EventArgs e)" method so that I can pass header on particular url ?

Jack
Posted 20 Jun, 2011 05:51:38 Top
Andrei Smolin


Add-in Express team


Posts: 17943
Joined: 2006-05-11
Hi Jack,

Have you tried using e.Headers in that event?

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Jun, 2011 06:11:30 Top
Jack Nerman




Posts: 15
Joined: 2011-06-17
Hi Andrei,

I am trying that but its not helpful.

private void ieModule_BeforeNavigate2(ADXIEBeforeNavigate2EventArgs e)
{
e.Cancel = true;
string URL = e.Url.ToString();
e.headers = "I AM APPLYING SOME HEADER HERE"
this.IEApp.Navigate(URL, e.Flags, e.TargetFrameName, e.PostData, e.Headers);
}

Is it possible to have a sample code for that?

Jack
Posted 22 Jun, 2011 06:40:25 Top
Andrei Smolin


Add-in Express team


Posts: 17943
Joined: 2006-05-11
Hi Jack,

Please check

- Address bar keyword event
- Bypass Basic Authentication
- Cancel navigation of a new window

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 22 Jun, 2011 06:51:43 Top
Jack Nerman




Posts: 15
Joined: 2011-06-17
Hi Andrei,

I have tried all ways but it seems all links not useful to me. I am trying like,

private void ieModule_BeforeNavigate2(ADXIEBeforeNavigate2EventArgs e)
{
	int loginStatusValue = GlobalData.Instance.LoadOptions();
	if (loginStatusValue == 2)
	{
		e.Cancel = true; 
		object url;
		int flags;
		string targetFrameName;
		object postData;
		string headers;

		url = e.Url;
		flags = e.Flags;
		targetFrameName = e.TargetFrameName;
		postData = e.PostData;
		headers = e.Headers;

		string base64 = "Basic " + EncodeTo64(usernmae + ":" + password);
		headers += HEADER_NAME + ":" + base64;
		headers += "

";

		Debug.WriteLine("headers: " + headers);

		this.IEApp.Navigate(url.ToString(), flags, targetFrameName, postData, headers);

		
	}
}



Can you please help me in this code.

Jack
Posted 22 Jun, 2011 09:39:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7234
Joined: 2004-07-05
Hi Jack,

Please try to call the IEApp.Stop method before the Navigate one.
Posted 22 Jun, 2011 11:13:50 Top