com.mohiva.play.silhouette.api.services
AuthenticatorService
Companion object AuthenticatorService
trait AuthenticatorService[T <: Authenticator] extends ExecutionContextProvider
Handles authenticators for the Silhouette module.
- T
The type of the authenticator this service is responsible for.
- Alphabetic
- By Inheritance
- AuthenticatorService
- ExecutionContextProvider
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
create(loginInfo: LoginInfo)(implicit request: RequestHeader): Future[T]
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.
-
abstract
def
discard(authenticator: T, result: Result)(implicit request: RequestHeader): Future[AuthenticatorResult]
Manipulates the response and removes authenticator specific artifacts before sending it to the client.
Manipulates the response and removes authenticator specific artifacts before sending it to the client.
- authenticator
The authenticator instance.
- result
The result to manipulate.
- request
The request header.
- returns
The manipulated result.
-
abstract
def
embed(value: T.Value, request: RequestHeader): RequestHeader
Embeds authenticator specific artifacts into the request.
Embeds authenticator specific artifacts into the request.
This method can be used to embed an authenticator in a existing request. This can be useful in Play filters. So before executing a SecuredAction we can embed the authenticator in the request to lead the action to believe that the request is a new request which contains a valid authenticator.
If an existing authenticator exists, then it will be overridden.
- value
The authenticator value to embed.
- request
The request header.
- returns
The manipulated request header.
-
abstract
def
embed(value: T.Value, result: Result)(implicit request: RequestHeader): Future[AuthenticatorResult]
Embeds authenticator specific artifacts into the response.
Embeds authenticator specific artifacts into the response.
- value
The authenticator value to embed.
- result
The result to manipulate.
- request
The request header.
- returns
The manipulated result.
-
implicit abstract
val
executionContext: ExecutionContext
The execution context to handle the asynchronous operations.
The execution context to handle the asynchronous operations.
- Definition Classes
- ExecutionContextProvider
-
abstract
def
init(authenticator: T)(implicit request: RequestHeader): Future[T.Value]
Initializes an authenticator and instead of embedding into the the request or result, it returns the serialized value.
Initializes an authenticator and instead of embedding into the the request or result, it returns the serialized value.
- authenticator
The authenticator instance.
- request
The request header.
- returns
The serialized authenticator value.
-
abstract
def
renew(authenticator: T, result: Result)(implicit request: RequestHeader): Future[AuthenticatorResult]
Renews the expiration of an authenticator.
Renews the expiration of an authenticator.
Based on the implementation, the renew method should revoke the given authenticator first, before creating a new one. If the authenticator was updated, then the updated artifacts should be embedded into the response.
- authenticator
The authenticator to renew.
- result
The result to manipulate.
- request
The request header.
- returns
The original or a manipulated result.
-
abstract
def
renew(authenticator: T)(implicit request: RequestHeader): Future[T.Value]
Renews the expiration of an authenticator without embedding it into the result.
Renews the expiration of an authenticator without embedding it into the result.
Based on the implementation, the renew method should revoke the given authenticator first, before creating a new one. If the authenticator was updated, then the updated artifacts should be returned.
- authenticator
The authenticator to renew.
- request
The request header.
- returns
The serialized expression of the authenticator.
-
abstract
def
retrieve[B](implicit request: ExtractableRequest[B]): Future[Option[T]]
Retrieves the authenticator from request.
Retrieves the authenticator from request.
- B
The type of the request body.
- request
The request to retrieve the authenticator from.
- returns
Some authenticator or None if no authenticator could be found in request.
-
abstract
def
touch(authenticator: T): Either[T, T]
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.
-
abstract
def
update(authenticator: T, result: Result)(implicit request: RequestHeader): Future[AuthenticatorResult]
Updates a touched authenticator.
Updates a touched authenticator.
If the authenticator was updated, then the updated artifacts should be embedded into the response. This method gets called on every subsequent request if an identity accesses a Silhouette action, expect the authenticator was not touched.
- authenticator
The authenticator to update.
- result
The result to manipulate.
- request
The request header.
- returns
The original or a manipulated result.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()