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.
- Alphabetic
- By Inheritance
- SocialStateHandler
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
abstract
type
Self <: SocialStateHandler
The concrete instance of the state handler.
Abstract Value Members
-
abstract
val
handlers: Set[SocialStateItemHandler]
The item handlers configured for this handler
-
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.
-
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.
-
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.
-
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.
-
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
-
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()