Play框架 - securesocial - 找不到合适的构造函数来实例化插件

时间:2014-07-12 19:49:18

标签: java playframework securesocial playframework-2.3

使用Play 2.3.1,Java,Scala 2.10.0

我正在尝试在我的网络项目中集成 securesocial

/build.sbt

  

lazy val root = project.in(file("。"))。enableableglugins(PlayJava)       scalaVersion:=" 2.11.1"

     

libraryDependencies ++ = Seq(jdbc,cache,filters,anorm,
  " com.typesafe.play.plugins" %%" play-plugins-util" %" 2.3.0",
  " com.typesafe.play.plugins" %%" play-plugins-mailer" %" 2.3.0",
  " org.mindrot" %" jbcrypt" %" 0.3m"," ws.securesocial" %%   " securesocial" %" master-SNAPSHOT " )

     

解析器+ = Resolver.sonatypeRepo("快照")

CONF / play.plugins

  

1500:com.typesafe.plugin.CommonsMailerPlugin   10001:securesocial.core.providers.FacebookProvider

CONF / securesocial.conf

securesocial {
    onLoginGoTo=/
    onLogoutGoTo=/login
    ssl=false   
    assetsController=controllers.ReverseMyCustomAssetsController

    userpass {      
        withUserNameSupport=false
        sendWelcomeEmail=true
        enableGravatarSupport=true
        signupSkipLogin=true
        tokenDuration=60
        tokenDeleteInterval=5
        minimumPasswordLength=8
        enableTokenJob=true
        hasher=bcrypt
    }
    twitter {
        requestTokenUrl="https://twitter.com/oauth/request_token"
        accessTokenUrl="https://twitter.com/oauth/access_token"
        authorizationUrl="https://twitter.com/oauth/authenticate"
        consumerKey=your_consumer_key
        consumerSecret=your_consumer_secret
    }

    facebook {
        authorizationUrl="https://graph.facebook.com/oauth/authorize"
        accessTokenUrl="https://graph.facebook.com/oauth/access_token"
        clientId=your_client_id
        clientSecret=your_client_secret
        # this scope is the minimum SecureSocial requires.  You can add more if required by your app.
        scope=email
    }

    google {
        authorizationUrl="https://accounts.google.com/o/oauth2/auth"
        accessTokenUrl="https://accounts.google.com/o/oauth2/token"
        clientId=your_client_id
        clientSecret=your_client_secret
        scope="https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"
    }
}

但低于错误

  

无法找到适当的构造函数来实例化插件   [securesocial.core.providers.FacebookProvider]。所有Play插件都必须   定义一个接受类型的单个参数的构造函数   用于Java插件的play.Application或用于Scala的play.api.Application   插件。

项目编制成功。

我缺少什么?任何指针对如何解决此问题都很有用

1 个答案:

答案 0 :(得分:1)

作为master中最新重构的一部分,模块不再使用插件。现在,您在RuntimeEnvironment中定义了使用插件指定的所有内容。

查看示例应用以查看其使用方式。