D
Donal
I have an aspx page with code behind in c#.
I am trying to get to grips with the PDS response.
If I use
LgnPsAu.asp and pass an incorrect username/password. I get an xml
result indication so. If i pass a correct username and password,
however, I get a 401 Unauthorized error, not an xml response. I am
using the Project Server administrator (not the domain one) as the
user.
I also get a 401 error if i try and use integrated authentication.
Can someone explain this to me?
Code snippet below.
Cheers
....
sURL = "http://server/projectserver/LgnPsAu.asp?un=person&pwd=password";
//Balks at next line with 401 error if username and password is ok!
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(sURL);
CookieContainer conCookie = new CookieContainer();
myReq.CookieContainer = conCookie;
myReq.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse myRes = (HttpWebResponse)myReq.GetResponse();
XmlDocument XMLDoc = new XmlDocument();
XMLDoc.Load(myRes.GetResponseStream());
Response.Write(XMLDoc.InnerXml);
myRes.Close();
....
I am trying to get to grips with the PDS response.
If I use
LgnPsAu.asp and pass an incorrect username/password. I get an xml
result indication so. If i pass a correct username and password,
however, I get a 401 Unauthorized error, not an xml response. I am
using the Project Server administrator (not the domain one) as the
user.
I also get a 401 error if i try and use integrated authentication.
Can someone explain this to me?
Code snippet below.
Cheers
....
sURL = "http://server/projectserver/LgnPsAu.asp?un=person&pwd=password";
//Balks at next line with 401 error if username and password is ok!
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(sURL);
CookieContainer conCookie = new CookieContainer();
myReq.CookieContainer = conCookie;
myReq.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse myRes = (HttpWebResponse)myReq.GetResponse();
XmlDocument XMLDoc = new XmlDocument();
XMLDoc.Load(myRes.GetResponseStream());
Response.Write(XMLDoc.InnerXml);
myRes.Close();
....