Ask a Question related to ASP.NET Security, Design and Development.
-
Mark Harris #1
NetworkCred and byref - Bug or by design??
Hi all
Have spent an annoying afternoon with this problem, and am wondering if anyone else has come accross it or whether it's known about.
Scenario is, i have NetworkCred object in one function, it get's passed BYREF to a function in another object ... which runs off to the registry to get the (encrypted) UID and Password. This function then decrpyts the UID / PWD, sets the properties on the NetwordCred object, and returns to the starting function. However, if i then try to use this NC object on a Web Service Proxy, i get a 401 Access Denied from my "Windows Auth"'ed webservice.
Note : When u check the username and Password properties of the NC object in the main function, they are saturated with the correct values.
However, if i dont call the external function that goes to the registry, and C&P it's code into the main function (ie. No need to pass the NC object byref!) and use the NC object on the Proxy, it runs the call perfectly well with no annoying 401's!!
eg.
'get login credentials for the webservice
objBroker = New DatabrokerServices.DatabrokerService 'the web service proxy
objUtil.GetServiceURL(mstrSERVICE_DATABROKER, strURL)
objBroker.Url = strURL
objCred = New System.Net.NetworkCredential
blnReturn = objUtil.GetServiceCredentials(mstrSERVICE_DATABROK ER, objCred)
objBroker.Credentials = objCred.GetCredential(New Uri(strURL), "Negotiate")
strResponseEnc = objBroker.Execute(strCommandEnc) ' Fails with a 401, uid / pwd properties have correct values
********
whereas, this code works fine ... and yet it's looking at the same registry settings!?
objCred = New System.Net.NetworkCredential
objCred.Username = objUtil.GetServiceUID(mstrSERVICE_DATABROKER)
objCred.Password = objUtil.GetServicePWD(mstrSERVICE_DATABROKER)
objBroker.Credentials = objCred.GetCredential(New Uri(strURL), "Negotiate")
strResponseEnc = objBroker.Execute(strCommandEnc)
**************************************
Explanations anyone??
Cheers
Mark
Mark Harris Guest
-
freelance web programming, web site design,c programming, java programming, VERY Low Cost web design and more
Find expert freelance programmers and designers at the prices you want to pay. Post your projects and programmers will place bids, you choose the... -
ByRef "The test form is only available for requests from the local machine"
When trying to call a method, that contains a ByRef Primitive Type (String), running on a remote machine, I get the message: The test form is... -
VBScript: What is default function parm type - ByVal or ByRef?
I know this should be a no-brainer, but I am seeing odd results in my ASP VBScript function calls with the passed parameters. In VBScript, is the... -
Passing Dictionary object byref
Passing Dictionary object byref Ive created an ASP class that uses a dictionary object which is filled from a recordset. It passes the object to... -
I love a Publisher design, can I import the design into Frontpage?
I'm establishing an identity for my new company using a Publisher design set. How do I use that basic design in Frontpage? Can I just creat a...



Reply With Quote

