2

For generating token, I have been relying on play.api.libs.Crypto.generateToken successfully. However it is now deprecated and the migration guide is not very clear to me.

Could anybody tell me:

  • which library I should include, preferable as sbt dependency
  • the actual function to call
John
  • 4,786
  • 8
  • 35
  • 44
  • What is this token used for? should it be generated based on a payload and password? or you just need a way to generate a unique string? – Tomer May 07 '17 at 14:51
  • used for token based authentication (OAuth) – John May 07 '17 at 23:07

1 Answers1

1

I use:

val token = (Random.alphanumeric take 40).mkString
Tomer
  • 2,398
  • 1
  • 23
  • 31