securesocial

Play-slick with SecureSocial: Running DB IO in a separate thread pool

落爺英雄遲暮 提交于 2019-12-12 07:53:33
问题 I have a Play 2.2.1 app that uses play-slick 0.5.0.8 to persist data to a Postgresql backend and SecureSocial 2.1.2 to handle user authorisation. Since play-slick transactions are blocking, I have created a separate slick-context execution context in my /conf/application.conf file, as per the instructions found in the plugin's Wiki: play { akka { actor { slick-context = { fork-join-executor { parallelism-min = 300 parallelism-max = 300 } } } } } This allows me to create a controller Action

Cast Class Exception in Scala: java.lang.Object to Scala CaseClass

ⅰ亾dé卋堺 提交于 2019-12-11 18:54:46
问题 This is driving me crazy - I'm working on play with scala, social secure etc and I keep getting this error when I'm trying to make a case class. Edit: similar question to this: Scala and Play2: ClassCastException: java.lang.Object cannot be cast to play.api.libs.json.JsValue Edit: moving the method createIdentityFromUser to the static companion class seems to fix this. Not sure why. [ClassCastException: java.lang.Object cannot be cast to securesocial.core.SocialUser] In /Users/tripled153

SecureSocial 3.0-M3 Custom Login view with play 2.3.9

江枫思渺然 提交于 2019-12-11 10:24:58
问题 I'm trying to build a custom login view using the latest version of SecureSocial 3.0-M3 and I've struggeling for few days with this. As suggested by fotis on the secureSocial Google Group, I created a MyViewTemplates class that extends ViewTemplates and overrides the required methods: package controllers import play.api.mvc.{RequestHeader, Request} import play.twirl.api.Html import securesocial.core.{BasicProfile, RuntimeEnvironment} import play.api.data.Form import play.api.i18n.Lang import

Upgrade to Play Framework 2.2 Securesocial problems

心已入冬 提交于 2019-12-11 05:49:48
问题 Hi I am trying to upgrade to Play 2.2 and am having some problems getting securesocial to work. I am using the latest snapshot as was suggested in the forums but get the error below. The verify error indicates compiled source incompatibility somewhere between binaries and the version I am using. I have tried switching between java 1.6 and 1.7 but get the same issue. I know securesocial is only ready for Play 2.1 but there are examples of Play 2.2 using securesocial snapshot. Perhaps I should

How to add extra field in SignUp form of scala SecureSocial

感情迁移 提交于 2019-12-11 05:47:35
问题 How to add extra field in SignUp form with my own validation.Shall I want to rewrite all views ,controllers from secure-social code. I try to add my custom login form as follows.Is it correct way to do? views.custom.SecuFocusTemplatesPlugin val contactForm = Form( mapping( "firstname" -> nonEmptyText(minLength=2, maxLength=64), "lastname" -> nonEmptyText(minLength=2, maxLength=64), "jobtitle" -> nonEmptyText(minLength=2, maxLength=64), "phone" -> nonEmptyText(minLength=2, maxLength=20),

How to install SecureSocial module in Play Framework 2.0.2?

我的梦境 提交于 2019-12-11 03:19:56
问题 I got this module https://github.com/jaliss/securesocial/ , and I don't even know how to make it work? 回答1: SecureSocial is delivered with samples in both: Java and Scala , you should examine them and reproduce required elements. I was testing samples last time and can ensure you that's good replacement for detailed documentation and how-to's 来源: https://stackoverflow.com/questions/11677952/how-to-install-securesocial-module-in-play-framework-2-0-2

play framework - securesocial userpass implementation

青春壹個敷衍的年華 提交于 2019-12-10 12:14:15
问题 I'm using Play 2.1 and securesocial master snapshot. I've implemented find & save of UserService (extends UserServicePlugin) as follows: Find method as below: def find(userId: UserId): Option[Identity] = { val user = User.findByUserId(userId); user match { case Some(user) => { val socialUser = new SocialUser(userId, null, null, user.name, Option(user.email), Option(user.photo), AuthenticationMethod("userPassword"), null, null, Some(PasswordInfo(PasswordHasher.BCryptHasher, BCrypt.hashpw(user

Login/Logout issue with Play Framework?

前提是你 提交于 2019-12-08 19:43:47
问题 After user Logout, if user click on browser back button then user get Login page without enter his credentials. Please suggest me how to overcome this problem. I am using Securesocial module. I am trying in so many ways: Set headres on response. Injecting meta tags to web pages. Using custom javascript I had set some headers on response object in logout action at server side https://groups.google.com/forum/#!topic/play-framework/SgcVCXxZb7g But the issue is not solved. Please help me. Thanks

Running EclipseLink metamodel generator in sbt?

走远了吗. 提交于 2019-12-08 12:21:06
问题 Using sbt, what should I do to execute annotation processor org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor provided by EclipseLink in order to generate the metamodel from my entity classes? 回答1: For the impatient Clone project ssdemojpa $ git clone http://github.com/frgomes/ssdemojpa Enter the commands below from the SBT console: zap reload metamodel compile test Detailed Description Project ssdemojpa provides a demo about how PlayFramework can be integrated with

Play securesocial - developer environment and unit testing

主宰稳场 提交于 2019-12-06 06:46:59
问题 We are using securesocial module for authentication in Play 2 application. I have two questions concerning this module. Firstly, is there an easy way to disable the authorization checking in out development environment, preferably w/o commenting all @SecureSocial.SecuredAction annotations. Secondly, what is the preferred way to unit test methods that use securesocial in Java? For example I have a call to ctx().args.get(SecureSocial.USER_KEY); in controller for getting the identity. If I would