Authenticating sessions with username/password works in desktop apps, where the session is kept open for the duration of the app. But what about web apps? The expected use case is that the user logs in once with a username and password, and he is authenticated for the duration of his session. What do you recommend here? That we store his username/password in session state, and use it for Session.Authenticate on every request? Or would it be better that we store his User ID (Key) in a cookie, and be able to authenticate with the key (plus possibly a token)... e.g. Session.Authenticate(UserIdFromCookie [, TokenFromCookie]). I don't like the idea of storing passwords in session state. |
Ara, These are 2 principally different operations: authentication & impersonation.
Hope that helps. |
Storing name & password is really bad idea. All you need is some identity allowing to identify the user.