Play 2.3.x 中的身份验证 [英] Authentication in Play 2.3.x

查看:17
本文介绍了Play 2.3.x 中的身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Play!框架 v2.3 (Java) 并且我想向我的网络应用程序添加一些用户身份验证,即每个用户的用户名/密码和注册过程.

I'm using the Play! framework v2.3 (Java) and I want to add some user authentication to my web app, ie username/password for each user and a registration process.

我在文档中找到了一些关于如何为 v2.1 和 v2.2 执行此操作的信息:http://www.playframework.com/documentation/2.1.0/JavaGuide4https://www.playframework.com/documentation/2.2.x/JavaGuide4

I found some information on the docs on how to do this for v2.1 and v2.2: http://www.playframework.com/documentation/2.1.0/JavaGuide4 https://www.playframework.com/documentation/2.2.x/JavaGuide4

但我找不到有关 v2.3 的任何更新信息.我已经尝试查看 play.mvc.Security.Authenticated 的 API,但它没有帮助(http://www.playframework.com/documentation/2.3.x/api/java/play/mvc/Security.Authenticated.html).

But I can't find any updated info on v2.3. I've already tried looking at the API for play.mvc.Security.Authenticated but it doesn't help (http://www.playframework.com/documentation/2.3.x/api/java/play/mvc/Security.Authenticated.html).

有人知道如何正确地做到这一点吗?

Anyone know how to do this properly?

推荐答案

已经存在许多涵盖许多用例的身份验证库.最好使用社区中成熟的东西.

There are a number of authentication libraries that already exist which cover many use cases. It'd be best to use something that's well established in the community.

Secure Social - 这似乎是最受欢迎的,有很多文档.(对于java和scala)

Secure Social - This seems to be the most popular, with lots of documentation. (For both java and scala)

Deadbolt 2 - 有许多从该 git 存储库链接的实现示例.似乎更适合java.

Deadbolt 2 - There are many implementation examples linked from that git repo. It seems a little more geared for java.

Play2 Auth - 这仅适用于 Scala,但它有据可查且非常灵活.(我个人使用 Play2 Auth)

Play2 Auth - This is for scala only, but it is well documented and very flexible. (I personally use Play2 Auth)

这篇关于Play 2.3.x 中的身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆