netcosports / android_ntlm Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi, Im getting the following error when trying to login via EWS on our office 365 account. I
Wonder if you have come accross this issue:
2019-06-14 16:24:44.061 8422-8541/com.example.app W/System.err: java.lang.IllegalArgumentException: bad base-64
2019-06-14 16:24:44.061 8422-8541/com.example.app W/System.err: at android.util.Base64.decode(Base64.java:161)
2019-06-14 16:24:44.062 8422-8541/com.example.app W/System.err: at android.util.Base64.decode(Base64.java:136)
2019-06-14 16:24:44.062 8422-8541/com.example.app W/System.err: at com.netcosports.ntlm.NTLMEngineImpl$NTLMMessage.<init>(NTLMEngineImpl.java:885)
2019-06-14 16:24:44.062 8422-8541/com.example.app W/System.err: at com.netcosports.ntlm.NTLMEngineImpl$Type2Message.<init>(NTLMEngineImpl.java:1152)
2019-06-14 16:24:44.062 8422-8541/com.example.app W/System.err: at com.netcosports.ntlm.NTLMEngineImpl.generateType3Msg(NTLMEngineImpl.java:1737)
2019-06-14 16:24:44.062 8422-8541/com.example.app W/System.err: at com.netcosports.ntlm.NTLMAuthenticator.authenticate(NTLMAuthenticator.java:41)
2019-06-14 16:24:44.062 8422-8541/com.example.app W/System.err: at okhttp3.internal.http.RetryAndFollowUpInterceptor.followUpRequest(RetryAndFollowUpInterceptor.java:288)
2019-06-14 16:24:44.062 8422-8541/com.example.app W/System.err: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:158)
2019-06-14 16:24:44.062 8422-8541/com.example.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at com.example.app.dependency_injection.modules.NetworkModule.lambda$ewsInterceptor$2(NetworkModule.java:109)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at com.example.app.dependency_injection.modules.-$$Lambda$NetworkModule$gJlLI1xFFHXNMXA26fwDcJD60fQ.intercept(Unknown Source:0)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2019-06-14 16:24:44.063 8422-8541/com.example.app W/System.err: at java.lang.Thread.run(Thread.java:764)
I simply use the library like:
return new OkHttpClient.Builder()
.connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.authenticator(new NTLMAuthenticator(Settings.getCalendarEmail(), Settings.getCalendarPassword(), null))
.followSslRedirects(true)
.followRedirects(true)
.protocols(Arrays.asList(Protocol.HTTP_1_1))
.addInterceptor(interceptor)
.build();
It works will on one exchange account just fine.
But when specifying autodiscovery url for our other office 365 account to be https://outlook.office365.com/autodiscover/autodiscover.svc
Im stuck at login.
Well this is not an issue I just wanted to implement NTLM authentication and post using SOAP after authentication.
Hey! Can you please specify the license type for this project?
https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-license-to-a-repository
When I don’t transfer the domain
like this
OkHttpClient client = new OkHttpClient.Builder ()
.authenticator (new NTLMAuthenticator (userName, password, null))
.build ();
Works fine
But When I pass domain
String userDomain = “ourdomain”;
OkHttpClient client = new OkHttpClient.Builder ()
.authenticator (new NTLMAuthenticator (userName, password, userDomain))
.build ();
I get an error
Too many follow-up requests
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.