Trait

com.mle.play.openid

OpenIdAuth

Related Doc: package openid

Permalink

trait OpenIdAuth extends Log

OpenID authentication. Only Google is supported for now. Usage:

Set a route in your routes file that leads to the handleOpenId method. For example:

GET  /oid  controllers.App.handleOpenId

Set another route that leads to the openIdCallback method, for example:

GET  /openidcb  controllers.App.openIdCallback

Define the openIdCallbackRoute of this trait to the route you specified:

protected def openIdCallbackRoute = routes.App.openIdCallback()

To start authentication, send the user to the OpenID route you first defined:

Redirect(routes.App.handleOpenId())

The authenticated email address is stored in the username session variable.

Linear Supertypes
Log, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. OpenIdAuth
  2. Log
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def isAuthorized(email: String): Boolean

    Permalink

    email

    email to validate

    returns

    true if the email is authorized to sign in, false otherwise

  2. abstract def onOpenIdFailure: Result

    Permalink

    Suggestion: redirect to an error page with an error message.

  3. abstract def openIdCallbackRoute: Call

    Permalink

    returns

    routes.YourPlayController.openIdCallback

    Attributes
    protected
  4. abstract def successRedirect: Call

    Permalink

    Implement something like: routes.Controller.homePage()

    Implement something like: routes.Controller.homePage()

    returns

    the place to go after the user is successfully authenticated

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def handleOpenId: Action[AnyContent]

    Permalink
  11. def handleOpenIdFailure(ex: Throwable, request: RequestHeader): Result

    Permalink

    Called if the OpenID authentication process fails.

    Called if the OpenID authentication process fails.

    Note that this is not called if the authorization fails; see onOpenIdUnauthorized(UserInfo) in that case.

    Attributes
    protected
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. val log: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Log
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def onOpenIdUnauthorized(userInfo: UserInfo): Result

    Permalink

    Called if the user has successfully authenticated, but is not authorized to access the resource/site.

    Called if the user has successfully authenticated, but is not authorized to access the resource/site.

    userInfo

    authenticated user

    returns

    the result

  19. def openIdCallback: Action[AnyContent]

    Permalink
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. def userString(user: UserInfo): String

    Permalink
  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Log

Inherited from AnyRef

Inherited from Any

Ungrouped