Trait

com.jaroop.play.sentry

AuthConfig

Related Doc: package sentry

Permalink

trait AuthConfig[E <: Env] extends AnyRef

The AuthConfig defines the behavior of an application where it intersects with the authentication and authorization system. This will allow Sentry to know how to find a user in your application, how to authorize them, and where to direct them when these actions succeed or fail.

Most of the work involved in integrating Play Sentry into your application is implementing your own AuthConfig. Your own AuthConfig should be a class that extends this type, fixes the Env type, and implements all of the methods to customize it to your application's desired behavior.

E

The environment type of your application.

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

Abstract Value Members

  1. abstract def authenticationFailed(request: RequestHeader)(implicit context: ExecutionContext): Future[Result]

    Permalink

    Called when a user attempts to access an action that requires authentication and they are not properly authenticated.

    Called when a user attempts to access an action that requires authentication and they are not properly authenticated. Implement this method to specify what happens when a user is not logged in. For example, return 403 Forbidden, or redirect them to a login page.

    request

    The unauthenticated request.

    returns

    The Result you would like to return to the user when they are unauthenticated.

  2. abstract def authorizationFailed(request: RequestHeader, user: E.User, authority: Option[E.Authority])(implicit context: ExecutionContext): Future[Result]

    Permalink

    Called when a user attempts to access an action that requires authorization, but they are not authorized via AuthConfig#authorize.

    Called when a user attempts to access an action that requires authorization, but they are not authorized via AuthConfig#authorize. Implement this method to specify what happens when a user is not authorized to access a resource. For example, return 403 Forbidden.

    request

    The unauthorized request.

    user

    The user that initiated the unauthorized request.

    authority

    The authority key the user was denied from accessing.

    returns

    The Result you would like to return to the user when they are unauthorized.

  3. abstract def authorize(user: E.User, authority: E.Authority)(implicit context: ExecutionContext): Future[Boolean]

    Permalink

    Determines whether or not a user is authorized to perform a certain action by authority key.

    Determines whether or not a user is authorized to perform a certain action by authority key. Implement this method to connect your own authorization scheme from your application.

    user

    The user requesting authorization to perform an action.

    authority

    The authority key associated with the action.

    returns

    True if the user is authorized, which will allow the action to proceed. Otherwise false, and the user will be denied access and informed via AuthConfig#authorizationFailed.

  4. abstract def loginSucceeded(request: RequestHeader)(implicit context: ExecutionContext): Future[Result]

    Permalink

    Determines where to redirect the user by default after successfully logging in.

    Determines where to redirect the user by default after successfully logging in. Implement this method to specify where to direct a user after Login#gotoLoginSucceeded is called.

    request

    The original request used to authenticate.

    returns

    A Result typically directing the user to a default URL to be seen after logging in, which will have additional headers applied to set cookies on top of the provided Result.

  5. abstract def logoutSucceeded(request: RequestHeader)(implicit context: ExecutionContext): Future[Result]

    Permalink

    Determines where to redirect the user by default after logging out.

    Determines where to redirect the user by default after logging out. Implement this method to specify where to direct a user after Logout#gotoLogoutSucceeded is called.

    request

    The request that initiated the logout action.

    returns

    A Result typically directing the user to a default URL to be seen after logging out, which will additionally contain headers to discard any Play Sentry cookies on top of the provided Result.

  6. abstract def resolveUser(id: E.Id)(implicit context: ExecutionContext): Future[Option[E.User]]

    Permalink

    Resolves a user by ID.

    Resolves a user by ID. Implement this method to connect the user type from your own application.

    id

    The ID of the user to find.

    returns

    The user, if found, otherwise None.

  7. abstract def sessionTimeout: Duration

    Permalink

    Defines the maximum lifespan of a session.

    Defines the maximum lifespan of a session. Each session's timeout is reset to this value every time a request from them is successfully authentiated.

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 hashCode(): Int

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

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

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

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

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

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped