com.mohiva.play.silhouette.impl.authenticators

JWTAuthenticatorService

class JWTAuthenticatorService extends AuthenticatorService[JWTAuthenticator] with Logger

The service that handles the JWT authenticator.

If the authenticator DAO is deactivated then a stateless approach will be used. But note that you will loose the possibility to invalidate a JWT.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JWTAuthenticatorService
  2. Logger
  3. AuthenticatorService
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JWTAuthenticatorService(settings: JWTAuthenticatorSettings, dao: Option[AuthenticatorDAO[JWTAuthenticator]], idGenerator: IDGenerator, clock: Clock)

    settings

    The authenticator settings.

    dao

    The DAO to store the authenticator. Set it to None to use a stateless approach.

    idGenerator

    The ID generator used to create the authenticator ID.

    clock

    The clock implementation.

Type Members

  1. case class AdditionalHeaders(existing: Headers, additional: Seq[(String, Seq[String])]) extends Headers with Product with Serializable

    Used to add additional headers to the existing headers.

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def create(loginInfo: LoginInfo)(implicit request: RequestHeader): Future[JWTAuthenticator]

    Creates a new authenticator for the specified login info.

    Creates a new authenticator for the specified login info.

    loginInfo

    The login info for which the authenticator should be created.

    request

    The request header.

    returns

    An authenticator.

    Definition Classes
    JWTAuthenticatorServiceAuthenticatorService
  9. def discard(authenticator: JWTAuthenticator, result: Future[Result])(implicit request: RequestHeader): Future[Result]

    Removes the authenticator from backing store.

    Removes the authenticator from backing store.

    authenticator

    The authenticator instance.

    result

    The result to manipulate.

    request

    The request header.

    returns

    The manipulated result.

    Attributes
    protected[com.mohiva.play.silhouette]
    Definition Classes
    JWTAuthenticatorServiceAuthenticatorService
  10. def embed(token: String, request: RequestHeader): RequestHeader

    Adds a header with the token as value to the request.

    Adds a header with the token as value to the request.

    token

    The token to embed.

    request

    The request header.

    returns

    The manipulated request header.

    Definition Classes
    JWTAuthenticatorServiceAuthenticatorService
  11. def embed(token: String, result: Future[Result])(implicit request: RequestHeader): Future[Result]

    Adds a header with the token as value to the result.

    Adds a header with the token as value to the result.

    token

    The token to embed.

    result

    The result to manipulate.

    request

    The request header.

    returns

    The manipulated result.

    Definition Classes
    JWTAuthenticatorServiceAuthenticatorService
  12. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. def init(authenticator: JWTAuthenticator)(implicit request: RequestHeader): Future[String]

    Creates a new JWT for the given authenticator and return it.

    Creates a new JWT for the given authenticator and return it. If a backing store is defined, then the authenticator will be stored in it.

    authenticator

    The authenticator instance.

    request

    The request header.

    returns

    The serialized authenticator value.

    Definition Classes
    JWTAuthenticatorServiceAuthenticatorService
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. val logger: Logger

    A named logger instance.

    A named logger instance.

    Definition Classes
    Logger
  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. def renew(authenticator: JWTAuthenticator, result: Future[Result])(implicit request: RequestHeader): Future[Result]

    Replaces the JWT header with a new one.

    Replaces the JWT header with a new one. If a backing store is defined, the old authenticator will be revoked. After that it isn't possible to use a JWT which was bound to this authenticator.

    authenticator

    The authenticator to update.

    result

    The result to manipulate.

    request

    The request header.

    returns

    The original or a manipulated result.

    Attributes
    protected[com.mohiva.play.silhouette]
    Definition Classes
    JWTAuthenticatorServiceAuthenticatorService
  24. def retrieve(implicit request: RequestHeader): Future[Option[JWTAuthenticator]]

    Retrieves the authenticator from request.

    Retrieves the authenticator from request.

    If a backing store is defined, then the authenticator will be validated against it.

    request

    The request header.

    returns

    Some authenticator or None if no authenticator could be found in request.

    Definition Classes
    JWTAuthenticatorServiceAuthenticatorService
  25. def serialize(authenticator: JWTAuthenticator): String

    Serializes the authenticator.

    Serializes the authenticator.

    authenticator

    The authenticator to serialize.

    returns

    The serialized authenticator.

    Attributes
    protected[com.mohiva.play.silhouette]
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. def touch(authenticator: JWTAuthenticator): Either[JWTAuthenticator, JWTAuthenticator]

    Touches an authenticator.

    Touches an authenticator.

    An authenticator can use sliding window expiration. This means that the authenticator times out after a certain time if it wasn't used. So to mark an authenticator as used it will be touched on every request to a Silhouette action. If an authenticator should not be touched because of the fact that sliding window expiration is disabled, then it should be returned on the right, otherwise it should be returned on the left. An untouched authenticator needn't be updated later by the update method.

    authenticator

    The authenticator to touch.

    returns

    The touched authenticator on the left or the untouched authenticator on the right.

    Attributes
    protected[com.mohiva.play.silhouette]
    Definition Classes
    JWTAuthenticatorServiceAuthenticatorService
  29. def unserialize(str: String): Try[JWTAuthenticator]

    Unserializes the authenticator.

    Unserializes the authenticator.

    str

    The string representation of the authenticator.

    returns

    An authenticator on success, otherwise a failure.

    Attributes
    protected[com.mohiva.play.silhouette]
  30. def update(authenticator: JWTAuthenticator, result: Future[Result])(implicit request: RequestHeader): Future[Result]

    Updates the authenticator and embeds a new token in the result.

    Updates the authenticator and embeds a new token in the result.

    To prevent the creation of a new token on every request, disable the idle timeout setting and this method will not be executed.

    authenticator

    The authenticator to update.

    result

    The result to manipulate.

    request

    The request header.

    returns

    The original or a manipulated result.

    Attributes
    protected[com.mohiva.play.silhouette]
    Definition Classes
    JWTAuthenticatorServiceAuthenticatorService
  31. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Logger

Inherited from AnyRef

Inherited from Any

Ungrouped