Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I consume a WCF REST service using Windows Authentication without .NET libraries?

I have a WCF client hosted in IIS7 and a WCF service hosted in IIS7. The client is strictly http/javascript and I'd like to keep it that way.

When I browse to the client webpage, I'm prompted for Windows Authentication credentials because the page is protected (and served with https). Once I've authenticated, my AJAX calls to the service (from the client) are not processed because I'm never given an opportunity to authenticate to the service itself.

What is the best way to implement security if I want to protect access to the service using Active Directory credentials but without using .NET libraries?

The specific response returned by the service is "401 (Unauthorized)". Note that the service is also served with https.

like image 607
Chad_C Avatar asked May 17 '11 14:05

Chad_C


People also ask

How do I pass credentials to WCF services for Windows authentication?

To configure a service to authenticate its clients using Windows Domain username and passwords use the WSHttpBinding and set its Security. Mode property to Message . In addition you must specify an X509 certificate that will be used to encrypt the username and password as they are sent from the client to the service.


1 Answers

Edit:

Update

There is a security mode for this as described here:

http://rickgaribay.net/archive/2007/04/04/recipe-wcf-basichttpbinding-with-windows-authentication.aspx

Below is for Android

I believe that it is possible. Althought, short of writing a custom implementation of NTML authentication, you will need to use a java third party libary.

I did have success with http://jcifs.samba.org/ running on Android. Unfortunately, I dont have the source code to share any more as we moved to a different authentication method.

I found that project through the following link: http://danhounshell.com/blog/android-using-ntlm-authentication-with-httpclient/

There is also another NTML project for AD integration which might help (i have no experience):

http://www.ioplex.com/jespa.html

hth

like image 188
Stuart Blackler Avatar answered Sep 20 '22 18:09

Stuart Blackler