Print Page | Close Window

OOB Offline Login

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2566
Printed Date: 28-Apr-2025 at 12:45am


Topic: OOB Offline Login
Posted By: steveprov
Subject: OOB Offline Login
Date Posted: 16-Mar-2011 at 5:58pm
We have a SL4 app using AspNetMembership and EntityManager.LoginAsync and all works very well. We now want to provide our users the ability to work in offline mode which seems doable according to the documentatiion.
 
What I can't seem to get a handle on is how to wire into the LoginAsync to enable me to provide some Offline Authentication and Autorization when disconnected from the Membership tables on the server.
 
I have already serialized the SessionBundle returned from an online login and saved it to Isolated storage then deserialized it but don't know what to do with it :-)
 
Any help would be great
 
Steve Provencher



Replies:
Posted By: DenisK
Date Posted: 17-Mar-2011 at 5:08pm
Hi steveprov;

As you have noted, when offline, there is no host to authenticate the user, and you cannot call the Login or LoginAsync method. However, this is okay, since there is no access to the database or other non-local datasource in this circumstance. 

To authenticate the user, you can:

1. Check for the successful decryption of the cache which will indicate that they have entered the correct credentials, or

2. If you are not encrypting the cache, compare the hash of the credentials to the locally stored hash that was computed from a prior successful login.

Hope this helps.


Posted By: steveprov
Date Posted: 18-Mar-2011 at 3:51am
Denis,
 
Thanks I have done #2 and am also encrypting the cache. I guess I was concered that Def Force would not work properly with a null SessionBundle. Turns oput that is not the case.
 
Thanks again



Print Page | Close Window