Webservice security

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Alex (alex_at_nospam.net)
Date: 02/26/04


Date: Thu, 26 Feb 2004 11:46:37 -0700

I am new to C# webservices, but not asp.net and windows development. I am
looking for help with security models. Basically, I have a webservice which
exposes a few functions, one of which is Login( string username, string
password, string application ). This login function will return an encrypted
key (string) to the user, and it will expire after 30 minutes.

I am wondering, for my webservice function signatures, should I include the
parameter ClientToken for each function call? Is there a better way to do
this using WSE? I would like to see how WSE works with sample code, not just
reading theories.

Is this a bad approach? What would WSE do for me that is different then
below? Thanks for the help.

[WebMethod]
public string Login( string username, string password, string app ){
    // validate your username, password, app ...
    return encryptedString;
}

[WebMethod]
public string GetSomeString( string something, string ClientToken ){
    // determine if the user is authenticated
    if( IsValidUser(ClientToken) ){
        // this is good, process and return some string ...
    }
    else {
        // user is not valid, return soap error
    }
}

public bool IsValidUser( string ClientToken ){
    // validate this ClientToken against our database
}



Relevant Pages

  • Re: How to send String to Webservice
    ... created pipeline that uses the file dis-assemble to convert to XML. ... > I want to be able to pass that XML file to a webservice as a string. ... Yes the WSDL is defined. ...
    (microsoft.public.biztalk.general)
  • Re: How to send String to Webservice
    ... While I agree with Christof completely, if you are determined to do it your ... >> It is converted to an XML file. ... >> I want to be able to pass that XML file to a webservice as a string. ...
    (microsoft.public.biztalk.general)
  • Re: DateTime WebService Discrepancy.
    ... When the datetime is sent by the webservice, ... > Ofcourse I had not even though of just passing a string as a parameter ... > locally and cut out the call to the web service. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Web Services nutzen in Silverlight 2
    ... Herrlich, mein erster Webservice, und das auch noch mit Silverlight :-) ... Public Function Result() As List ... Public Property IDAs Integer ... Public Property Col1As String ...
    (microsoft.public.de.german.entwickler.dotnet.asp)
  • Re: text gets destroyed
    ... An alternative is to build a proxy yourself using wsdl.exe (in the .NET ... > In the call to my webservice i changed field3 to the following: ... > If you have any explanation on why it cant send the string to a webservice ... >>> Tried to do the messagebox trick just before calling the webservice. ...
    (microsoft.public.dotnet.framework.compactframework)