I have a requirement to consume Dynamics GP native web service from Java and i am using Apache CXF to create the soap client. We are using kerbaros authentication as part of CXF (spnego).
We are able to call the web service from a .net based soap client from the same computer by passing the username, password and domain name as input for authentication.
But with java.. we are getting SocketTimeoutException as below.
[Krb5LoginModule] authentication failed
org.apache.cxf.interceptor.Fault: General security error (An error occurred in trying to obtain a TGT: Receive timed out)
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.DualStackPlainDatagramSocketImpl.socketReceiveOrPeekData(Native Method)
at java.net.DualStackPlainDatagramSocketImpl.receive0(DualStackPlainDatagramSocketImpl.java:124)
at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:143)
at java.net.DatagramSocket.receive(DatagramSocket.java:812)
at sun.security.krb5.internal.UDPClient.receive(NetClient.java:206)
at sun.security.krb5.KdcComm$KdcCommunication.run(KdcComm.java:411)
at sun.security.krb5.KdcComm$KdcCommunication.run(KdcComm.java:364)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.krb5.KdcComm.send(KdcComm.java:348)
at sun.security.krb5.KdcComm.sendIfPossible(KdcComm.java:253)
at sun.security.krb5.KdcComm.send(KdcComm.java:229)
at sun.security.krb5.KdcComm.send(KdcComm.java:200)
at sun.security.krb5.KrbAsReqBuilder.send(KrbAsReqBuilder.java:316)
at sun.security.krb5.KrbAsReqBuilder.action(KrbAsReqBuilder.java:361)
at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:766)
... 40 more
We have login.config and krb5.conf files as below.
login.config ==============
spnego-client {
com.sun.security.auth.module.Krb5LoginModule required
debug=true
refreshKrb5Config=true;
};
======================
krb5.conf================
[libdefaults]
default_realm=DOMAIN1.MYCOMPANY.LOCAL
[realms]
DOMAIN1.MYCOMPANY.LOCAL = {
kdc=MACHINE01.domain1.mycompany.local
default_domain=DOMAIN1.MYCOMPANY.LOCAL
}
[domain_realm]
.domain1.mycompany.local=DOMAIN1.MYCOMPANY.LOCAL
domain1.mycompany.local=DOMAIN1.MYCOMPANY.LOCAL
=======================
Endpoint : http://MACHINE01:112233/Dynamics/GPService/GPService
client.getRequestContext().put("ws-security.callback-handler", new NamePasswordCallbackHandler("UERNAME", "PASSWORD"));
*This post is locked for comments
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156