Doesn't execute anything after controller in Play with Silhouette

86 views
Skip to first unread message

Malti Yadav

unread,
Jul 22, 2016, 7:01:23 AM7/22/16
to Silhouette

I'm using Silhouette v4.0 with Play Framework(Scala) v2.5.4. When I deploy my app to Heroku it runs fine, but when I try to run/debug it on localhost the debugger comes to the Action/SecuredAction line but doesn't execute anything after that.


My application.conf contains followings properties:-


play.modules.enabled += "modules.SilhouetteModule"
play.modules.disabled += "com.mohiva.play.silhouette.api.actions.SecuredErrorHandlerModule"
play.modules.disabled += "com.mohiva.play.silhouette.api.actions.UnsecuredErrorHandlerModule"

play.i18n.langs = ["en"]

play.http.requestHandler = "play.api.http.DefaultHttpRequestHandler"

play.http.filters = "utils.Filters"
play.filters.headers.contentSecurityPolicy="default-src 'self'; img-src 'self' fbcdn-profile-a.akamaihd.net *.twimg.com *.googleusercontent.com *.xingassets.com vk.com *.yimg.com secure.gravatar.com; style-src 'self' 'unsafe-inline' maxcdn.bootstrapcdn.com cdn.jsdelivr.net fonts.googleapis.com; font-src 'self' fonts.gstatic.com fonts.googleapis.com maxcdn.bootstrapcdn.com; connect-src 'self' twitter.com *.xing.com"
play.filters.csrf.cookie.name="PLAY_CSRF_TOKEN" // We store the CSRF token in a cookie instead of the session so that Angular can read it
play.filters.csrf.contentType.blackList=[ // We would also check AJAX requests from type application/json
  "application/x-www-form-urlencoded",
  "multipart/form-data",
  "text/plain",
  "application/json"
]

Christian Kaps

unread,
Jul 25, 2016, 2:46:22 AM7/25/16
to Silhouette
Hi,

have you enabled logging?


If your debugger stops in a SecuredAction then it's an authentication problem. Do you use a persistent storage or the in-memory storage? The in-memory storage gets cleaned in the development environment after a code change.

Best,
Christian

Malti Yadav

unread,
Jul 26, 2016, 7:02:42 AM7/26/16
to Silhouette
Thanks @Christian
It have been fixed . It was not silhouette issues . We have to set  PLAY_CSRF_TOKEN  in request header.
Reply all
Reply to author
Forward
0 new messages