web-services - 使用 apache2 php 页面和 tomcat REST 调用进行身份验证

标签 web-services rest authentication tomcat apache2

你好 stackoverflow 上的聪明人,
如果有人能指出正确的库/框架来做我想做的事,我会很高兴。

我们设置了以下网络架构。

 1. We have a tomcat server that offers REST services.
 2. We have an apache2 server that serves up php pages to users.
    a. Some of these php pages make REST calls to tomcat for data.
    b. Other php pages contain javascript that makes REST calls that are routed through apache2 via mod_proxy to tomcat. e.g. All request to http://myapache.com/PASSTOTOMCAT/rest/getSecureData would go to tomcat.

现在,我被要求为所有内容添加身份验证,包括用户页面和 REST 调用。显然,用户只需登录一次即可访问两者,这显然是理想的选择。

为此我可以使用什么库?我不认为我可以使用任何基于 php 的解决方案(即涉及添加的解决方案),因为传递 url 将没有机会添加此代码并检查身份验证。我想我需要使用 apache2 本身内置的东西。

一个次要要求是我希望将用户凭据存储在 mysql 数据库中而不是文件中。

我是不是想多了?

提前致谢

最佳答案

已经 5 天了,所以我想我会回答我自己的问题...

我最终使用新的 mod_auth_form 进行身份验证,因为它可以让您使用漂亮的程式化网页让用户登录。 我还使用 mod_dbd 访问 mysql 中的用户凭据。

我找不到这方面的好教程,所以我在安装和设置过程中费了一番功夫,但如果有人关心,我在我的博客上创建了一组说明,以防其他人尝试做同样的事情。
Installation
Setup

关于web-services - 使用 apache2 php 页面和 tomcat REST 调用进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14970421/

相关文章:

iphone - 保护 WCF REST 服务以用于 iPhone 应用程序

python - Django + Auth0 JWT 认证拒绝解码

java - Spring security 3 在使用 OpenID 进行身份验证时忽略禁用/锁定标志

java - 使用数组让访客登录管理系统

从 native 应用程序进行 Azure Active Directory 身份验证,无需用户登录

c# - 英国火车信息API?

java - 服务器需要客户端证书时如何使用 wsimport?

java - 是否能够在构建过程中将 REST 端点标记为忽略?

c# - 从 ASMX WebService 中删除空命名空间

python - 通过 HTTP2 提供 Python (Flask) REST API