I'm trying to use Deadbolt for authorization and Silhouette or SecureSocial for authentication using Play 2.3.3 and Scala 2.11.1.
MyDeadboltHandler has a getSubject to override and to do that I need to retrieve the user from the request. Using SecureSocial 2 that was quite straight forward.
override def getSubject[A](request: Request[A]): Option[Subject] = {
SecureSocial.currentUser(request) match {
case Some(identity) => // Subject could be created and returned
case _ => None
}
I am not able to find any method in Silhouette to get the "current user". Also both Silhouette and SecureSocial have a SecuredRequest[AnyContent] (extended WrappedRequest) while getRequest method in MyDeadboltHandler expects a Request[A]. SecuredRequest is defined in the a trait which is not visible in MyDeadboltHandler.
Any advice is highly appreciated.