"Logging in" to a WCF service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nathan.alden@gmail.com

    #1

    "Logging in" to a WCF service

    I have a Windows application that must "log in" to a remote service.
    Once logged in, for all subsequent service calls the Windows
    application should somehow pass a "session context" in each message to
    the service, which will then be compared to session information stored
    in SQL Server. However, for each service call a new client proxy is
    created, i.e. I'm not reusing the same proxy over and over.
    Essentially, I need to emulate what traditional ASP.NET sessions do.

    I've done pretty much all the research I can looking into WCF
    federation (RSTRSTR) but haven't come up with anything understandable.
    I also know that WCF's concept of a session is not inherently
    sufficient for what I'd like to do. I was curious what best practices
    there were or whether anyone else has attempted something like this.

    Thanks.
  • Jeremy Shovan

    #2
    Re: "Loggin g in" to a WCF service

    I have done something similar to this a while back with WCF. I ended up
    using an encrypted token that held a session id and the time that the token
    was created (used for expiration). We had a "log in server" that held
    authentication information, this server would create our token and pass it
    onto the server that is hosting the WCF service. If I recall correctly I
    used an HttpModule to grab the encrypted token off of the request and
    validated it at that time.. if it wasn't valid I simply closed the response
    stream.

    You could probably use something similar to this only hold an id in your
    encrypted token that identifies session information that you have stored in
    SQL Server. Just include the token on each of your calls through your
    various proxies.

    Jeremy Shovan



    <nathan.alden@g mail.comwrote in message
    news:61287791-c803-4954-8ca6-8bd86732951d@56 g2000hsm.google groups.com...
    I have a Windows application that must "log in" to a remote service.
    Once logged in, for all subsequent service calls the Windows
    application should somehow pass a "session context" in each message to
    the service, which will then be compared to session information stored
    in SQL Server. However, for each service call a new client proxy is
    created, i.e. I'm not reusing the same proxy over and over.
    Essentially, I need to emulate what traditional ASP.NET sessions do.
    >
    I've done pretty much all the research I can looking into WCF
    federation (RSTRSTR) but haven't come up with anything understandable.
    I also know that WCF's concept of a session is not inherently
    sufficient for what I'd like to do. I was curious what best practices
    there were or whether anyone else has attempted something like this.
    >
    Thanks.

    Comment

    Working...