views:

12

answers:

1

Hi All,

I'm creating a WPF application, for which all users must be authenticated to an Active Directory. - Clientside, i'm using Client Application Services. - Server-side, i have an asp.net web application with a AspNetActiveDirectoryMembershipProvider.

All is working as expected.

There's one catch however. Some of the wpf application users log in with their windows in to the domain, others don't.

So for the users which are logged in to the domain (group A), I do not want to ask for their username/password at application startup. The other users (group B) of course have to supply their Active Directory Username/password at application startup. This group B just perform Membership.ValidateUser(userName, password), ending up in the AspNetActiveDirectoryMembershipProvider and be authenticated.

However, how can I check for group A that they have been succesfully authenticated to the AspNetActiveDirectoryMembershipProvider, without having to ask their username/password?

Thanks, Koen

A: 

Application services uses an http transport. There is no concept of tokens (the thing you get when you log in to your machine/domain) so unless you wish to completely rewrite an application services implementation (not.. not... not recommended) there is no way around logging in regardless of current authentication.

But this leads me to the question: If they are logged in to the domain, why are you using application services?

In your app, you could first check to see if the current identity belongs to the domain in question and if it is authenticated. If so proceed with the application. If not, fall back on Application services.

This type of hybrid is not terribly complicated but it will require a bit of planning and code on your part.

Sky Sanders
My solution is indeed first checking if it belongs to the domain, if not falling back on Application Services.However, ideally, I would have loved to keep all authentication / authorization logic behind the interface of the Application Services. If I want to switch from Windows-based authentication to for instance database-based authentication, I have to modify both client and server.Thanks for your feedback,Koen
KoenJ