我正在阅读scalatra authentication tutorial。Scalatra认证
根据DB,AuthenticationSupport特性写了我自己的验证策略,将basicAuth()
添加到控制器,现在授权工作。但我还是不明白,我怎么可以把从会话中获取的用户ID和我应该如何使用方法toSession
和fromSession
此:
protected def fromSession = { case id: String => AuthUser(id) }
protected def toSession = { case usr: AuthUser => usr.id }
您的链接已损坏 – 2015-02-02 14:12:55
因此它被更新为指向http://www.codeitall.com/2014/11/30/getting-started-with-scentry-for-scalatra/ – XeroxDucati 2015-02-02 14:20:16
仍然破损.. 。 – Federico 2016-09-10 17:13:58