Results 1 to 6 of 6

Thread: Security on Webservice?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Location
    Falkenberg, Sweden
    Posts
    76

    Security on Webservice?

    I want to create a webservice where the user (the one accessing the webservice) must use a username and password to access it.

    Does anyone have any experience of this and how it can be done?

    Thanks in advance!
    ________________________
    Fredrik Klarqvist

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    You just call a login function thta returns wether the logon was successful or not passing the username and password as parameters. Works just like calling any other function on your client.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Addicted Member nickname's Avatar
    Join Date
    Sep 2004
    Location
    Europe - Belgium
    Posts
    170

    Re: Security on Webservice?

    Hello..

    I'm looking how to get the username from the client.

    I use following code:
    Code:
    Dim objWinId As System.Security.Principal.WindowsIdentity=System.Security.Principal.WindowIdentity.GetCurrent
    Dim strUserName() As String = Split(objWinId.Name, "\")
    Dim sUsername As String = strUserName(1).ToLower
    
            Me.txtPersoon.Text = sUsername
    But it only works when I run it on my developing machine. When i run it from the server it wont take the usernamen from the visitor..

    any suggestions?

    nickname
    Software Engineer
    DBA
    Webdesigner
    --
    to code or to be coded, that's the question

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Security on Webservice?

    Ah, you want the windows credentials? You should set the DefaultCredentials object's properties in that case.

  5. #5
    Addicted Member nickname's Avatar
    Join Date
    Sep 2004
    Location
    Europe - Belgium
    Posts
    170

    Re: Security on Webservice?

    Quote Originally Posted by mendhak
    Ah, you want the windows credentials? You should set the DefaultCredentials object's properties in that case.
    and where can I conigure the DefaultCredentials object's properties?


    tnx in advance

    nickname
    Software Engineer
    DBA
    Webdesigner
    --
    to code or to be coded, that's the question

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Security on Webservice?

    VB Code:
    1. webserviceclass.Credentials = System.Net.CredentialCache.DefaultCredentials;

    Try that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width