简体   繁体   English

jetty web 应用程序多个身份验证选项

[英]jetty web app multiple authentication options

I have successfully set up jetty (Version: 9.4.32.v20200930) to serve my web application with FORM authentication.我已成功设置 jetty(版本:9.4.32.v20200930)来为我的 Web 应用程序提供 FORM 身份验证。 This is a deployed context XML setup with a web app folder, containing a WEB-INF folder, containing a web.xml file, etc.这是一个部署的上下文 XML 设置,带有一个 web 应用程序文件夹,包含一个 WEB-INF 文件夹,包含一个 web.xml 文件等。

I have also successfully set it up to use OpenID authentication by activating and configuring jetty's "openid" module.我还通过激活和配置 jetty 的“openid”模块成功地将其设置为使用 OpenID 身份验证。

Now I can switch authentication methods by simply changing the context XML and web.xml files and redeploying the web app.现在,我可以通过简单地更改上下文 XML 和 web.xml 文件并重新部署 Web 应用程序来切换身份验证方法。

What I would like to achieve is to be able to use both authentication methods at the same time, depending on user preference.我想要实现的是能够同时使用两种身份验证方法,具体取决于用户偏好。 Some users may have an OpenID account and log in this way;部分用户可能有OpenID账号,并以这种方式登录; other users may only have "local" accounts so they should be able to use the FORM authentication method.其他用户可能只有“本地”帐户,因此他们应该能够使用 FORM 身份验证方法。 Each type of user (OpenID/local) may have a different login URL;每种类型的用户(OpenID/local)可能有不同的登录 URL; this is perfectly reasonable.这是完全合理的。

Obviously, changing context XML and web.xml files requires redeploying the app, so it is not a usable option.显然,更改上下文 XML 和 web.xml 文件需要重新部署应用程序,因此它不是一个可用的选项。

Duplicating the app and deploying it twice would work but, concurrency considerations aside, this doesn't feel right at all.复制应用程序并将其部署两次是可行的,但是,除了并发性考虑之外,这感觉根本不对。

Is there any way to have both authentication methods at the same time for a single web application?有没有办法同时为单个 Web 应用程序使用两种身份验证方法?

It is not currently possible to have more than one Jetty authentication mechanism enabled at the same time.目前不可能同时启用一种以上的 Jetty 身份验证机制。

It would be useful if Jetty could support this use case, so I will investigate to see if this can be implemented.如果 Jetty 可以支持这个用例,那将会很有用,所以我会调查看看是否可以实现。 I have opened an issue on the jetty project github to track the progress on this.在码头项目 github 上打开了一个问题来跟踪这方面的进展。

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

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