Hi,
I am building an application dat uses a (wse)webservice in two different
scenario's: within a domein and outside a domein, somewhere over the
internet.
Requests to the webservice need to be authenticated.
My approach: try to get a kerberos-ticket:
private KerberosToken GetKerberosToken()
{
try
{
string targetPrincipalName = null;
targetPrincipalName = "host/" + System.Net.Dns.GetHostName();
return new KerberosToken(targetPrincipalName);
}
catch
{
return null;
}
}
If this returns null, the application must be running outside the domein.
In this case a form pops up for the user to type his/her username/password.
In this case a usernametoken is setup and send to the webservice.
proxy.SlimDossierWse _slimDOssier=new proxy.SlimDossierWse();
_slimDOssier.RequestSoapContext.Security.Tokens.Add(new
UsernameToken("username@domein", "password",
PasswordOption.SendPlainText));
This works fine. Problem is that when I try to attach the kerberos ticket
to the webservice is this way:
try
{
proxy.SlimDossierWse _slimDOssier=new proxy.SlimDossierWse();
_slimDOssier.ResponseSoapContext.Security.Tokens.Add(kerbToken);
_slimDOssier.ResponseSoapContext.Security.Elements.Add(new
EncryptedData(kerbToken));
_slimDOssier.ResponseSoapContext.Security.Timestamp.TtlInSeconds=60;
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(string.Format("error: {0}
\n{1}",ex.Message, ex.Source));
}
I keep getting this error: "object reference not set to an instance of an
object"
I cannot step through the code when this error occurs because my develop
machine is not within the domein, I can ony run the compiled version on a
computer in the domein.
Where am I going wrong?
Greetings,
Roland

Signature
---
Roland Wolters
http://www.habbiebabbie.net
***** Please react via UseNet only ********
Roland Wolters - 04 Aug 2004 09:23 GMT
> Hi,
>
[quoted text clipped - 65 lines]
>
> Roland
please, someone....look in to this!

Signature
---
Roland Wolters
http://www.habbiebabbie.net
***** Please react via UseNet only ********