Playframework 如何在play frame work 1.2.4中自定义social Security模块中的authenticate()方法

Playframework 如何在play frame work 1.2.4中自定义social Security模块中的authenticate()方法,playframework,securesocial,Playframework,Securesocial,我想在play framework 1.2.4中的controllers.securesocial中自定义authenticate(),因为在登录到使用play framework的应用程序之前,我需要验证一些内容。您可以尝试验证自定义类中的内容,扩展UserServicePlugin,scala和java中的示例如下: 这些方法在使用securesocial插件的play应用程序的整个登录过程生命周期中被调用 class MyUserService(application: Applicati

我想在play framework 1.2.4中的controllers.securesocial中自定义authenticate(),因为在登录到使用play framework的应用程序之前,我需要验证一些内容。

您可以尝试验证自定义类中的内容,扩展
UserServicePlugin
,scala和java中的示例如下:

这些方法在使用securesocial插件的play应用程序的整个登录过程生命周期中被调用

class MyUserService(application: Application) extends UserServicePlugin(application) {
  /**
   * Finds a user that maches the specified id
   *
   * @param id the user id
   * @return an optional user
   */
  def find(id: UserId):Option[Identity] = {
    // implement me
  }

  /**
   * Finds a user by email and provider id.
   *
   * Note: If you do not plan to use the UsernamePassword provider just provide en empty
   * implementation.
   *
   * @param email - the user email
   * @param providerId - the provider id
   * @return
   */
  def findByEmailAndProvider(email: String, providerId: String):Option[Identity] =
  {
    // implement me
  }

  /**
   * Saves the user.  This method gets called when a user logs in.
   * This is your chance to save the user information in your backing store.
   * @param user
   */
  def save(user: Identity) {
    // implement me
  }

  /**
   * Saves a token.  This is needed for users that
   * are creating an account in the system instead of using one in a 3rd party system.
   *
   * Note: If you do not plan to use the UsernamePassword provider just provide en empty
   * implementation
   *
   * @param token The token to save
   * @return A string with a uuid that will be embedded in the welcome email.
   */
  def save(token: Token) = {
    // implement me
  }


  /**
   * Finds a token
   *
   * Note: If you do not plan to use the UsernamePassword provider just provide en empty
   * implementation
   *
   * @param token the token id
   * @return
   */
  def findToken(token: String): Option[Token] = {
    // implement me
  }

  /**
   * Deletes a token
   *
   * Note: If you do not plan to use the UsernamePassword provider just provide en empty
   * implementation
   *
   * @param uuid the token id
   */
  def deleteToken(uuid: String) {
    // implement me
  }

  /**
   * Deletes all expired tokens
   *
   * Note: If you do not plan to use the UsernamePassword provider just provide en empty
   * implementation
   *
   */
  def deleteExpiredTokens() {
    // implement me
  }
}