验证在播放2.3.x版本 [英] Authentication in Play 2.3.x

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

问题描述

我使用的是玩游戏!框架V2.3(爪哇),我想一些用户身份验证添加到为每个用户和注册过程中我的web应用,即用户名/密码。

我发现对如何做到这一点的V2.1和V2.2的文档的一些信息:
<一href=\"http://www.playframework.com/documentation/2.1.0/JavaGuide4\">http://www.playframework.com/documentation/2.1.0/JavaGuide4
<一href=\"https://www.playframework.com/documentation/2.2.x/JavaGuide4\">https://www.playframework.com/documentation/2.2.x/JavaGuide4

但我无法找到任何V2.3更新的信息。我已经尝试过寻找的play.mvc.Security.Authenticated的API,但它并不能帮助(<一href=\"http://www.playframework.com/documentation/2.3.x/api/java/play/mvc/Security.Authenticated.html\">http://www.playframework.com/documentation/2.3.x/api/java/play/mvc/Security.Authenticated.html).

任何人都知道如何正确地做到这一点?


解决方案

有一些已经存在的认证库,其中涵盖许多用例。这将会是最好用东西是完善的社区。

确保社会 - 这似乎是最流行的,有很多文档。 (为Java和Scala)

呆2 - 有来自混帐回购协议连接起来的实现示例。这似乎对Java多一点的齿轮。

Play2验证 - 这只是斯卡拉,但它是有据可查的,非常灵活。 (我个人使用Play2验证)

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.

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

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 - This seems to be the most popular, with lots of documentation. (For both java and scala)

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

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

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

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