Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2004

Tip: Looking for answers? Try searching our database.

Problem with wse-kerberos authentication

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roland Wolters - 03 Aug 2004 15:14 GMT
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 ********


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.