简体   繁体   中英

Application for Windows tablet using Windows Authentication

We have this rather big and complex line-of-business system that has multiple desktop applications and 3 or 4 web portals deployed in the intranet but also outside, for the external users of the system.

Towards the end of the project, we have received some additional change requests to add 3 small applications that are supposed to work on some Windows 8.1 Pro Dell Tablets. One of the requirements that were given to us is to use Windows Authentication to identify the current user of the application. The system we built contains an SQL Server database at its core, so these 3 new tablet apps would have to serve data coming from there.

I am trying to figure out what's the best way to proceed while designing and developing these three small apps.

On one hand, I have the option of developing a Windows Store application. I won't be able to use Entity Framework (as I did for some of the desktop XAML applications) but I can build some RESTful Web API that I can consume. However, I read that Windows Store apps cannot easily be used in conjunction with Windows Authentication (some are saying that is downright impossible to have Windows Authentication in WinStore apps) so that seems to be a major show-stopper for us right now.

On the other hand, I could build a regular WPF application that would allow me to use EF and Windows Authentication with no issues. But I would be missing the functionality to tap, swipe, pinch and all the other great touch features that are available for Windows Store apps for tablets, features that I believe our client would expect. There is Telerik's UI for WPF, but that would add more costs to the client and I am not even sure the API will give me the entire functionality available out of the box in WinRT.

Has anyone found a way to marry the best of both worlds?

EDIT: Upon further research, I found out that Windows Store applications can be sideloaded, which is a way to bypass the Windows Store. So now I only need to figure out if sideloaded apps can use Integrated Security on a Windows 8 Pro tablet.

There are two solutions:

1) use the Azure AD authentication Library (ADAL) : The ADAL Client Enables Application developers to Easily authenticate users to cloud or on-premises Active Directory (AD), And Then obtenir access tokens for Securing API calls. ADAL HAS Many features authentication That Make Easier for developers, Such As asynchronous support, a configurable caching That token stores access tokens tokens and refresh, automatic refresh token expires When an access token and a refresh token is available, and more. By handling MOST of the complexity, ADAL can help a developer focus on business logic implementation and In Their Easily secure resources without Being an expert on security. here you will not find step how to connect to AD using ADAL https://www.nimbo.com/blog/use-azure-active-directory-adal-windows-store-app/

2) Using .Net Framework. Create à WCF Service in local et use this :

public bool AuthenticateUserService(string path, string user, string pass)
{
    DirectoryEntry de = new DirectoryEntry(path, user, pass, AuthenticationTypes.Secure);
    try {
        //run a search using those credentials.  
        //If it returns anything, then you're authenticated
        DirectorySearcher ds = new DirectorySearcher(de);
        ds.FindOne();
        return true;
    } catch {
        //otherwise, it will crash out so return false
        return false;
    }
}

then you consume this service from your Windows Store App.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM