简体   繁体   English

非Java Web应用程序以针对Java servlet进行身份验证

[英]Non-Java web application to authenticate against a Java servlet

We have a Java EE web application deployed to JBoss . 我们已经将Java EE Web应用程序部署到JBoss This web application is used for authentication purposes. 该Web应用程序用于身份验证。

Now we would like to have other web applications that are not written in Java to communicate and authenticate against this web application. 现在,我们希望拥有其他不是用Java编写的Web应用程序来针对该Web应用程序进行通信和身份验证。 The reason we want to do this is: Suppose we have a small web application that does a simple task for the user. 我们这样做的原因是:假设我们有一个小型Web应用程序,它可以为用户完成简单的任务。 This web application could be implemented purely with the plain HTML stack plus a little bit of JavaScript, hence we would like to not introduce the complexity of Java EE into it. 该Web应用程序可以完全用纯HTML堆栈和少量JavaScript来实现,因此我们不想在其中引入Java EE的复杂性。

Is there a good way of doing this both secured and efficiently? 是否有一种既安全又有效的方法呢?


More information: 更多信息:

The web application used for authentication is a huge Java EE program with other functionalities. 用于身份验证的Web应用程序是具有其他功能的巨大Java EE程序。 We'd like to slowly get rid of it, and part of this process involves moving some of its functionalities outside the stack. 我们希望慢慢摆脱它,并且此过程的一部分涉及将其某些功能移出堆栈。

At this phase, we are leaving the authentication module as is, and start with other parts of the program (hence why we don't want to bundle these small web applications with the main program and uses Java EE). 在此阶段,我们将保留身份验证模块,并从程序的其他部分开始(因此,为什么我们不想将这些小型Web应用程序与主程序捆绑在一起并使用Java EE)。

You can put static HTML and JavaScript code inside a Java EE web application. 您可以将静态HTML和JavaScript代码放入Java EE Web应用程序中。 Why not just put it there since you have the application anyway (and need it for authentication I assume) and then add appropriate mappings to your web.xml so you can only access those pages if you're logged in. 为什么不把它放在那里,因为无论如何您都拥有该应用程序(我认为它需要进行身份验证),然后将适当的映射添加到您的web.xml这样您只有登录后才能访问那些页面。

It's a little difficult to answer, because I'm not sure exactly what these other pages will be doing, how they will relate to the Java web application and so on. 回答起来有点困难,因为我不确定这些其他页面将要做什么,它们将如何与Java Web应用程序关联等等。

If all you need is authentication, here's a small and lightweight open source library, http://spnego.sourceforge.net , that is installed as a servlet filter. 如果您只需要身份验证,这里是一个小型轻量级的开源库http://spnego.sourceforge.net ,它作为servlet过滤器安装。

They also have examples on how to use a SOAP client with a protected web service. 他们还提供了有关如何将SOAP客户端与受保护的Web服务一起使用的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM