Web Login - Remember Me and it's effect on the Session("CSLAPrincipal")

Web Login - Remember Me and it's effect on the Session("CSLAPrincipal")

Old forum URL: forums.lhotka.net/forums/t/459.aspx


kdubious posted on Saturday, June 24, 2006

I'm stuck...

If the user checked the 'Remember Me' box in Login Control in my web app, when they come back the MembershipProvider seems to authenticate them just fine.  BUT, the user doesn't have the appropriate CustomIdentity that I wrote.

I'm using <deny users="?">, so the site doesn;t allow anonymous access.

I need a seuugestion for how and when to reload my session("CSLAPrincipal") when the user returns having clicked the Remember Me box.

Any ideas?  Am I missing something obvious?

 

Kevin

RockfordLhotka replied on Saturday, June 24, 2006

Some event must fire in global.asax, or from the login control, so you can detect that this has occurred.

William replied on Monday, June 26, 2006

I think I will look into BeginRequest event in global.asax, where the server code attempts to retrieve an encrypted security token from in-memory session or client's cookie. If the security token is found, the server code can decrypt it to retrieve the corresponding BusinessPrincipal from the db.

 

kdubious replied on Tuesday, June 27, 2006

William:

I think I will look into BeginRequest event in global.asax, where the server code attempts to retrieve an encrypted security token from in-memory session or client's cookie. If the security token is found, the server code can decrypt it to retrieve the corresponding BusinessPrincipal from the db.

 

William, if I do this, how do I get the password to re-login the user?  I guess I could create a Username only version of Login, or store the pass in the cookie, but both sound like bad security. 

Am I missing something?

RockfordLhotka replied on Wednesday, June 28, 2006

I would create a Login method that only takes a username - I've done this numerous times. In this context, CSLA isn't providing the security anyway - that is coming from ASP.NET. You are merely loading a pre-authenticated principal for the purpose of authorization, which is something quite different.
 
Rocky

kdubious replied on Saturday, July 01, 2006

This is what I ended up doing. 

Something seems strange about this entire mechanism....  I just can't find any way for the MembershipProvided to manage this. 

William replied on Sunday, July 02, 2006

In the "security token" being created, you can choose to embed both the user name and password, then encrypt them with some secured key on the server. The end users would not be able to decrypt this encrypted data you stored on the client.

Alternatively, you can choose to create an overloaded Login method, which takes only the user name as parameter.

 

Regards,
William

 

RockfordLhotka replied on Monday, June 26, 2006

I am at a client site until June 29, with limited email until then.

Thank you for your understanding,

Rocky

RockfordLhotka replied on Monday, June 26, 2006

I am at a client site until June 29, with limited email until then.

Thank you for your understanding,

Rocky

Copyright (c) Marimer LLC