c# - Soap service credential available from InputStream -
for project doing, using soap service access data system. added soap service web reference asp.net (c#) project.
now, service kinda complicated, because user has authenticated first cookie (don't ask). did was:
- the user accesses our website.
- website redirects user logon page on server service located.
- user logs on, , formsauthentication.setauthcookie performed
- user redirected our site. forwards user page should contain data webservice.
that page instantiates webservice object this:
myservice.myserviceservice = new myservice.myservice();
then put credentials in (now hardcoded):
service.preauthenticate = true; service.credentials = new networkcredential("wim", "mypass");
when call method on service, want global.asax on server containing server, able "catch" username , password request. somehow cannot fetch it.
don't ask why has done this, lets call .. unfortunate :p
does know how fetch username , password request on server side, preferable in global.asax application_beginrequest.
what authentication mode service using? basic, digest? etc.
if basic, username , password in http header base64 encoded string gwxhcgrpbjpvcgvuifnlc2ftzg==.
you'll need decode , you'll see username , password in format user:password.
where looking/expecting find username , password?
as side note: if you're writing service well, should use "authentication" module rather doing in global. hook onauthenticate event of global in httpmodule , authentication there.
Comments
Post a Comment