LCHCAPITALHUMAIN / exjello

Automatically exported from code.google.com/p/exjello
MIT License
0 stars 0 forks source link

NTLM Authentication Support #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to authenticate with a domain user into OWA
2.
3.

What is the expected output? What do you see instead?
GRAVE: Credentials cannot be used for NTLM authentication: 
org.apache.commons.httpclient.UsernamePasswordCredentials

What version of the product are you using? On what operating system?
java.version=1.6.0_20
javamail-1.4.3

Please provide any additional information below.

I'm using a simple (but hope usefull) patch for ExchangeConnection.java

[...]
// Put after AuthScope authScope = new AuthScope(host, port);
        if (username.indexOf("\\") < 0) {
            client.getState().setCredentials(authScope,
                    new UsernamePasswordCredentials(username, password));
        } else {
            // Try to connect with NTLM authentication
            String domainUser = username.substring(username.indexOf("\\")+1,username.length());
            String domain = username.substring(0,username.indexOf("\\"));
            client.getState().setCredentials(authScope,
                    new NTCredentials(domainUser, password, host, domain));         
        }
[...]

Original issue reported on code.google.com by amirco on 4 Aug 2010 at 12:55

Attachments:

GoogleCodeExporter commented 8 years ago
An example

[...]
Store store = new ExchangeStore(session, null);
store.connect("ExchangeServer", "DOMAIN\\UserAccount:UserMailbox", 
"UserPassword");
[...]

Original comment by amirco on 19 Aug 2010 at 11:43

GoogleCodeExporter commented 8 years ago
Thanks for the patch for NTLM authentication! I was running into issues and the 
patch worked like a charm! And also thanks to Eric for exjello!

Original comment by chris.do...@gmail.com on 7 Oct 2010 at 4:13

GoogleCodeExporter commented 8 years ago
if you check out lastest sources feature is included

Original comment by amirco on 7 Oct 2010 at 4:57

GoogleCodeExporter commented 8 years ago

Original comment by amirco on 26 Oct 2010 at 9:43