How to use active directory with cache when my Windows Store App client is disabled

I am developing a Windows Store app for business. The client application connects to the server and can only enter the server if it has the correct credentials and belongs to the correct domain.

But when a connection is not available to connect the client to the server, the user must use the cached user credentials provided by Active Directory so that the user can work offline. The problem is that Windows Store apps use Azure Active Directory, so I have to be connected to the Internet.

I would like to be able to search for a user and verify credentials in almost the following way using DirectoryEntry and DirectorySearcher , which are in the System.DirectoryServices namespace of a regular Windows Desktop application:

DirectoryEntry directoryEntry = new DirectoryEntry("LDAP://" + domain, username, password, AuthenticationTypes.Secure); DirectorySearcher directorySearcher = new DirectorySearcher(directoryEntry); directorySearcher.FindOne(); 
+6
source share
1 answer

There is actually a conflict in what you are trying to achieve:

  • you use the active directory to be able to authenticate someone against the central user repository (which is much harder to crack than any representation of the local user's credentials).
  • You do not want to use the central active directory because it costs you an Internet connection.

Others do the following:

  • everything that can be done without authentication is allowed on clients without authentication (for example, create a draft version of something, prepare a proposal for a change)
  • everything that is required for authentication requires genuine authentication with a real Internet connection (check that the drafts are activated, apply the changes).

Usually this is where such software projects become 2-10 times more complex than authentication projects or without authentication. Good luck.

+4
source

Source: https://habr.com/ru/post/976041/


All Articles