问题
I have a Java Enterprise Edition web application, a standard WAR. I want to integrate this with an existing .NET infrastructure running IIS. To be specific, I need to be able to share user sessions between the two applications in some secure manner.
Is there a "standard" way of doing this?
Edit: I do not need full session sharing, sorry for not pointing that out. What I need to be able to do is to check if a user is authenticated with the .NET application when she connects to the Java EE application.
回答1:
Create a .NET web service (using WCF, of course) to return whether a user is authenticated. Then call that web service from the Java EE application.
回答2:
Very doubtful.
You'd have to persist session state to a third component, such as a database. I doubt that the built-in providers for either infrastructure are at all similar (as far as schemas, etc); so you'd like have to create your own.
This does not sound like it would be a fun thing to do.
回答3:
If they will run on the same server, you will need an isapi redirect filter, like the isapi_redirect.dll that comes with Tomcat.
回答4:
This open source library, http://spnego.sourceforge.net, will enable your java app to do transparent/integrated windows authentication.
It's installed as a servlet filter so you will not have to write any code.
来源:https://stackoverflow.com/questions/834667/java-ee-integration-with-net-for-authentication