Are there any alternatives for JCIFS NTLM library?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Actually jcifs is good and you can test easily the 4-way handshake locally with Windows IIS and a keep alive java Socket.
This 2004 Apache pseudo code is useful to build the algorithm with jcifs using
generateType1Msg()
andgenerateType3Msg()
, even Apache promotes an example as an alternative to HttpClient.The old Apache code from 2004 works but authentication is unstable, you get
HTTP/1.1 401 Unauthorized
frequently, also this really old code from Luigi Dragone does not work anymore. On the other hand Apache's HttpClient runs smoothly but the handshake is done behind the scene (fyi. HttpClient requiresnew NTCredentials()
to define user's authentication).Here's an example to test the handshake locally on IIS, on port 81 without a domain. You need to change the
host
,port
,user
andpassword
and HTTP headers appropriately, eventuallyWWW-Authenticate
if you are not using IIS.HTTP/1.1 200 OK
means the authentication is correct, otherwise you getHTTP/1.1 401 Unauthorized
.To be honest, you should not look for one. For your SSO needs you should use proper kerberos / SPNEGO instead of the legacy NTLM.
For that stuff you need no special libraries as JVMs are already enabled for doing that automatically. All you have to do is to configure your application and JVM security policies properly. The official documentation from Sun should give you all the details you need, just browse the "security APIs" section.
Waffle - https://github.com/dblock/waffle
Has filters, authenticators, supports spring-security, etc. Windows-only, but doesn't require native DLLs.
I think NTLM is being deprecated in favor of Kerberos/SPNEGO. Take a look at the SPNEGO HTTP Servlet Filter project to see if it might fit your needs.
If you don't mind a commercially packaged product then take a look at: Quest Single Sign On for Java which provides support for SPNEGO/Kerberos (including sites and S4U protocols) as well as NTLM.
jespa www.ioplex.com is the only one I've come across. Never used it though