建议使用什么软件来使用 Happstack Web 开发套件进行身份验证?

发布于 2024-12-02 00:14:53 字数 255 浏览 1 评论 0原文

上周,我们三个人花了两天时间尝试使用 Happstack 构建一个简单的 Web 应用程序。我们关心的问题之一是身份验证,似乎曾经有一个看起来非常好的 Happstack.Auth 包。不幸的是,原来的项目似乎已经被放弃了,虽然已经有一个分叉,但我们无法让分叉来构建。

人们建议使用哪些替代方案在 Happstack 中进行身份验证? happstack-auth 可行吗?

Last week three of us spent two days trying to build a simple web application using Happstack. One of our concerns is authentication, and it appears there was once a Happstack.Auth package that looks really good. Unfortunately the original project seems to have been abandoned, and although there has been a fork, we could not get the fork to build.

What alternatives do people recommend for doing authentication in Happstack?
Is happstack-auth viable?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

¢蛋碎的人ぎ生 2024-12-09 00:14:53

您可能会考虑 happstack-authenticate 作为替代方案,

darcs get http://src.seereason.com/happstack- authenticate/

happstack-authenticate 构建在authenticate 和 pwstore 之上,提供:

  1. 标准用户名/密码身份验证
  2. openid 身份验证
  3. facebook connect

代码的设计使得它可以与多种不同的模板解决方案一起使用。不过,目前只有 HSP 模板。

它还没有被破解,但将会。我希望它成为事实上的 happstack 身份验证解决方案。

您可以在此处看到它的操作:

http://www.seereason.com/

源代码包括一个演示带有独立示例的目录。

该代码可以工作——尽管仍然需要添加一些功能。例如,如果您被重定向到登录页面,那么您最终应该被转发回登录后尝试访问的原始页面。

目前最大的缺点是文档。这将得到解决。

您会注意到 happstack-authenticate 使用 web-routes 来实现类型安全的 url,并使用 Acid-state 来存储身份验证信息。然而,这些设计选择不必渗透到应用程序的其余部分。

您使用什么模板解决方案?我有兴趣添加对其他系统的支持。

——杰里米

附注如果你看一下代码,它可能看起来比预期的要复杂一些。这是因为它的设计允许:

  1. 单个配置文件的多种身份验证方法

    例如,您可以将多个 openid 帐户链接到同一个配置文件。也许是因为您担心您可能会失去对主要 openid 帐户的访问权限。或者您可能希望团队中的每个人都使用共享帐户登录。 (例如,在像 twitter 这样的网站上,您可能希望多个人能够通过公司帐户发布推文)。

  2. 单一身份验证方法的多个配置文件

    在像 Twitter 这样的网站上,您可能有多个帐户。例如,我有关于我自己、我的摄影、我的音乐、happstack、seereason 等的 Twitter 帐户。与其对每个帐户进行单独的身份验证,不如进行一次身份验证,然后选择我想要成为的“配置文件”。

当然,使用 happstack-authenticate 的站点不必支持这些选项。

You might consider happstack-authenticate as an alternative,

darcs get http://src.seereason.com/happstack-authenticate/

happstack-authenticate builds on top of authenticate and pwstore to provide:

  1. standard username/password authentication
  2. openid authentication
  3. facebook connect

The code is designed so that it can be used with multiple different templating solutions. Though, at the moment, there is only HSP templates.

It is not on hackage yet, but will be. I expect it to become the de facto happstack authentication solution.

You can see it is action here:

http://www.seereason.com/

The source code includes a demo directory with a self contained example.

The code works -- though there are some features that still need to be added. For example, if you get redirected to a login page, you should ultimately be forwarded back to the original page you were trying to access after you are logged in.

The biggest shortcoming at the moment is documentation. That will be addressed.

You will notice that happstack-authenticate uses web-routes for type-safe urls and acid-state for storing authentication information. However, those design choices do not have to leak into the rest of your application.

What template solution are you using? I would be interested in adding support for additional systems.

-- jeremy

p.s. If you look at the code, it may seem a bit more complex than expected. That is because it is designed to allow for:

  1. multiple authentication methods for a single profile

    For example, you could link multiple openid accounts to the same profile. Perhaps because you are afraid that you might lose access to your primary openid account. Or maybe you want everyone on your team to login using a shared account. (For example, on a site like twitter, you might want multiple people to be able to post tweets through the company account).

  2. multiple profiles for a single authentication method

    On a site a like twitter, you might have multiple accounts. For example, I have twitter accounts for, myself, my photography, my music, happstack, seereason, and more. Instead of having a separate authentication for each account, it would be nice to have a single authentication, and then pick which 'profile' I want to be.

sites using happstack-authenticate do not have to support these options, of course.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文