Packages

t

play.silhouette.impl.providers

SocialStateHandler

trait SocialStateHandler extends AnyRef

Provides a way to handle different types of state for providers that allow a state param.

Some authentication protocols defines a state param which can be used to transport some state to an authentication provider. The authentication provider sends this state back to the application, after the authentication to the provider was granted.

The state parameter can be used for different things. Silhouette provides two state handlers out of the box. One state handler can transport additional user state to the provider. This could be an URL were the user should be redirected after authentication to the provider, or any other per-authentication based state. An other important state handler protects the application for CSRF attacks.

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

Type Members

  1. abstract type Self <: SocialStateHandler

    The concrete instance of the state handler.

Abstract Value Members

  1. abstract val handlers: Set[SocialStateItemHandler]

    The item handlers configured for this handler

  2. abstract def publish[B](result: Result, state: SocialState)(implicit request: ExtractableRequest[B]): Result

    Publishes the state to the client.

    Publishes the state to the client.

    B

    The type of the request body.

    result

    The result to send to the client.

    state

    The state to publish.

    request

    The current request.

    returns

    The result to send to the client.

  3. abstract def serialize(state: SocialState): String

    Serializes the given state into a single state value which can be passed with the state param.

    Serializes the given state into a single state value which can be passed with the state param.

    state

    The social state to serialize.

    returns

    The serialized state as string.

  4. abstract def state(implicit ec: ExecutionContext): Future[SocialState]

    Gets the social state for all handlers.

    Gets the social state for all handlers.

    ec

    The execution context to handle the asynchronous operations.

    returns

    The social state for all handlers.

  5. abstract def unserialize[B](state: String)(implicit request: ExtractableRequest[B], ec: ExecutionContext): Future[SocialState]

    Unserializes the social state from the state param.

    Unserializes the social state from the state param.

    B

    The type of the request body.

    state

    The state to unserialize.

    request

    The request to read the value of the state param from.

    ec

    The execution context to handle the asynchronous operations.

    returns

    The social state on success, an error on failure.

  6. abstract def withHandler(handler: SocialStateItemHandler): Self

    Creates a copy of the state provider with a new handler added.

    Creates a copy of the state provider with a new handler added.

    There exists two types of state handlers. The first type are global state handlers which can be configured by the user with the help of a configuration mechanism or through dependency injection. And there a local state handlers which are provided by the application itself. This method exists to handle the last type of state handlers, because it allows to extend the list of user defined state handlers from inside the library.

    handler

    The handler to add.

    returns

    A new state provider with a new handler added.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped