Skip to content

Instantly share code, notes, and snippets.

@jeroenr
Created July 17, 2017 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeroenr/b36a67f43c6cf940cd33ae9eb843a43c to your computer and use it in GitHub Desktop.
Save jeroenr/b36a67f43c6cf940cd33ae9eb843a43c to your computer and use it in GitHub Desktop.
JWT encode Auth info
val authInfo = AuthInfo(
referenceToken = "8dd95893-0915-4c3a",
userId = "bc522019-1445-4c1f-85fc-753342a71634",
permissions = Nil,
groupIds = Nil,
expirationDate = None
)
val claim = authInfo.toJson
val jwt = Jwt.encode(
JwtClaim(claim).issuedNow,
SHARED_SECRET,
JwtAlgorithm.HS256
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment