SharePoint Webservice from Java Webapp using CXF with Kerberos/NTLM authentication

白昼怎懂夜的黑 提交于 2019-12-11 04:59:01

问题


I have a Java EE web application from the web app I have to consume a SharePoint web-service which expects Kerberos/NTLM authentication how can I achieve. I am using CXF for consuming web-service and the web application it self uses Windows Integrated Authentication for authentication.


回答1:


Take a look at the SPNEGO protocol, this is what Sharepoint ( technically IIS ) uses for Single Sign On authentication. I am not familar with CXF, but generally most of the WebServices platforms allow you to supply additional headers with your request. Basically what you need is:

1.  Get authentication token for the sharepoint from user session  

2.  Use JAAS to generate tokens.

Look here http://appliedcrypto.com/spnego/spnego_jaasclient.html and here http://docs.oracle.com/javase/6/docs/technotes/guides/security/jgss/lab/part6.html for more details.

For the case when you want to authenticate browser users to sharepoint. You have to implement SPNEGO protocol in your web app for example you can use this package do it you. Most of the modern app servers support SPNEGO protocol [ JBoss, WebSphere ]. After you implemented SPNEGO protocol, you can grab the kerberos token from 'Authorization' header.

Then you have two options:

  1. In case you run your web-app with the same identity as the SharePoint front-end you can just resend the same token to the sharepoint.

  2. In case you running as a different identity, you have to use the user's token to go to active directory and request a ticket for sharepoint service on behalf of your user. The account that your web-app runs under has to be trusted for delegation in Active Directory

Also, I am not sure that SharePoint accepts kerberos tokens within SOAP headers, I believe you have to authenticate using HTTP headers.

This question might help you

If you want to use single sign on feature meaning using current user identity take a look here



来源:https://stackoverflow.com/questions/9361840/sharepoint-webservice-from-java-webapp-using-cxf-with-kerberos-ntlm-authenticati

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!