本文整理汇总了Scala中com.mohiva.play.silhouette.password.BCryptPasswordHasher类的典型用法代码示例。如果您正苦于以下问题:Scala BCryptPasswordHasher类的具体用法?Scala BCryptPasswordHasher怎么用?Scala BCryptPasswordHasher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BCryptPasswordHasher类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Scala代码示例。
示例1: User
//设置package包名称以及导入依赖的类
package models
import java.util.UUID
import com.mohiva.play.silhouette.api.Identity
import com.mohiva.play.silhouette.password.BCryptPasswordHasher
import play.api.libs.json.Json
case class User(
id: Option[UUID],
email: String,
emailConfirmed: Boolean,
password: String,
nick: String,
firstName: String,
lastName: String,
services: List[String]
) extends Identity {
def key = email
def fullName: String = firstName + " " + lastName
}
object User {
val services = Seq("serviceA", "serviceB", "serviceC")
implicit val jsonFormat = Json.format[User]
val users = List(
User(Some(UUID.fromString("3f145a02-7e5d-11e6-ae22-56b6b6499611")), "[email protected]", true, (new BCryptPasswordHasher()).hash("123123").password, "Eddy", "Eddard", "Stark", List("master")),
User(Some(UUID.fromString("3f145c82-7e5d-11e6-ae22-56b6b6499611")), "[email protected]", true, (new BCryptPasswordHasher()).hash("123123").password, "Maggy", "Margaery", "Tyrell", List("serviceA")),
User(Some(UUID.fromString("3f145d86-7e5d-11e6-ae22-56b6b6499611")), "[email protected]", true, (new BCryptPasswordHasher()).hash("123123").password, "Petyr", "Petyr", "Baelish", List("serviceB")),
User(Some(UUID.fromString("3f145e62-7e5d-11e6-ae22-56b6b6499611")), "[email protected]", true, (new BCryptPasswordHasher()).hash("123123").password, "Tyry", "Tyrion", "Lannister", List("serviceA", "serviceB"))
)
}