[play] JWT token 예제

scala 2018. 2. 9. 12:09




https://www.playframework.com/documentation/2.6.x/SettingsSession



application.conf 설정


# jwt

play.http.session.maxAge = 60 minutes




소스


Ok("Welcome!").withSession(

  "connected" -> "user@gmail.com")





실제 jwt 토큰으로 오는 값(curl 명령어로 확인할 수 있음)


Set-Cookie: PLAY_SESSION=eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImNvbm5lY3RlZCI6InVzZXJAZ21haWwuY29tIn0sImV4cCI6MTUxODA4Mzk0OSwibmJmIjoxNTE4MDgwMzQ5LCJpYXQiOjE1MTgwODAzNDl9.ZqgXH3x6gEDwXZdFcZJ3i9lDSuO2JO8q3kZdzOUsKBU; Max-Age=3600; Expires=Thu, 08 Feb 2018 20:59:09 GMT; SameSite=Lax; Path=/; HTTPOnly






Posted by 김용환 '김용환'

댓글을 달아 주세요