Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have SharePoint Server 2010 with windows authentication(ntlm).

We are working in java and want to authenticate a user, which is in active directory.

We tried using authentication.asmx but it returned "NotInFormsAuthenticationMode".

I read on the internet that I need to enable forms authentication on my website.

But I don't want to enable forms authentication, so I just want to know is there any way that I can authenticate users without enabling form authentication?

One more question, if I enable forms authentication, will the authentication.asmx authenticate users in active directory?

share|improve this question
    
What are you trying to achieve ? Are you trying to enable single sign on for the java and sharepoint . Or you want to enable AD authentication in Java? –  Thomson Dec 8 '11 at 11:29
add comment

2 Answers

up vote 0 down vote accepted

Authentication.asmx provides user authentication only for SharePoint sites that use forms-based authentication.

If you want to use SharePoint web services you can pass windows credentials as below :

serviceProxy.Credentials = new NetworkCredential("UserName", "Password", "domain");

OR

serviceProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
share|improve this answer
add comment

Authentication.asmx doesn't need to be used. You should be able to pass the authentication details directly as part of the HTTP request object for the web service that you want to use.

I am no expert on implementing Java-based HTTP requests, but it looks like this link should give you some idea on how your request needs to be structured: http://blog.whitehorses.nl/2011/01/23/using-a-servlet-to-connect-to-ntlm-web-service/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.