Class

com.jaroop.play.sentry

Login

Related Doc: package sentry

Permalink

class Login[E <: Env] extends AnyRef

The Login component provides the user's first entry point into Play Sentry via your application.

It is up to your application to decide when a user is to be logged-in (i.e. provides the correct credentials to a login form of some kind), and from there your controller can use this component to create a session for that user by their ID. To use it, you simply inject Login into your controller, and call gotoLoginSucceeded(userId) when you want to grant a session to a user linked to a particular userId.

@Singleton
class Application @Inject() (login: Login[MyEnv], userService: UserService) extends InjectedController {
    def login = Action.async(parse.urlEncodedForm) { implicit request =>
        // logic to determine to handle user name and password..
        gotoLoginSucceeded(userId)
    }
}
E

The environment type of your application.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Login
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Login(config: AuthConfig[E], idContainer: IdContainer[E.Id], tokenAccessor: TokenAccessor)

    Permalink

    config

    Requires an AuthConfig to determine the default Result to return to the user once logged-in.

    idContainer

    The IdContainer that will store the session server-side.

    tokenAccessor

    The TokenAccessor that will store the session client-side.

    Annotations
    @Inject()

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 gotoLoginSucceeded(userId: E.Id, result: ⇒ Future[Result])(implicit request: RequestHeader, ctx: ExecutionContext): Future[Result]

    Permalink

    Creates a new session for a user, and allows a custom result (different than from the AuthConfig) to be returned to them once the session has been created.

    Creates a new session for a user, and allows a custom result (different than from the AuthConfig) to be returned to them once the session has been created.

    userId

    The ID of the user to grant the session to.

    result

    The Result to return to the user once their session is created.

    returns

    The given Result with an AuthenticityToken included.

  11. def gotoLoginSucceeded(userId: E.Id)(implicit request: RequestHeader, ctx: ExecutionContext): Future[Result]

    Permalink

    Creates a new session for a user.

    Creates a new session for a user.

    userId

    The ID of the user to grant the session to.

    returns

    The default Result defined in the AuthConfig when the user is logged-in, with an AuthenticityToken included.

  12. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  17. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped