I am trying to use Deadbolt for authentication and Silhouette or SecureSocial for authentication using Play 2.3.3 and Scala 2.11.1.
MyDeadboltHandler has a getSubject to override and for this I need to extract the user from the request. Using SecureSocial 2 was pretty simple.
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 can not find any method in Silhouette to get the "current user". Silhouette and SecureSocial also have SecuredRequest [AnyContent] (extended WrappedRequest), and the getRequest method in MyDeadboltHandler expects Request [A]. SecuredRequest is defined in a dash that is not visible in MyDeadboltHandler.
Any advice is highly appreciated.
source share