package api
The collection of traits and utility classes that form the stable API of Silhouette.
- Alphabetic
- By Inheritance
- api
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
- package actions
- package crypto
- package exceptions
Provides exceptions used by the API.
- package repositories
Provides repositories used by the API to persist entities.
- package services
Provides services used by the API to call external or internal services.
- package util
Provides utilities used by the API.
Type Members
- trait AuthInfo extends AnyRef
A marker trait for authentication information.
- final case class AuthenticatedEvent[I <: Identity](identity: I, request: RequestHeader) extends SilhouetteEvent with Product with Serializable
An event which will be published if a request passes authentication.
An event which will be published if a request passes authentication.
- I
The type of the identity.
- identity
The logged in identity.
- request
The request header for the associated request.
- trait Authenticator extends AnyRef
An authenticator recognizes an authenticated user.
- trait Authorization[I <: Identity, A <: Authenticator] extends AnyRef
A trait to define Authorization objects that let you hook an authorization implementation in secured endpoints.
A trait to define Authorization objects that let you hook an authorization implementation in secured endpoints.
- I
The type of the identity.
- A
The type of the authenticator.
- trait DefaultErrorHandler extends Results with Status with ContentTypes with RequestExtractors with Rendering
Provides the base implementation for the default error handlers.
- trait DefaultNotAuthenticatedErrorHandler extends NotAuthenticatedErrorHandler with DefaultErrorHandler with I18nSupport with Logger
Handles not authenticated requests in a default way.
- trait DefaultNotAuthorizedErrorHandler extends NotAuthorizedErrorHandler with DefaultErrorHandler with I18nSupport with Logger
Handles not authorized requests in a default way.
- trait Env extends AnyRef
The environment type.
The environment type.
Defines the Identity and Authenticator types for an environment. It is possible to implement as many types as needed. This has the advantage that an application isn't bound only to a single
Identity->Authenticatorcombination.To define a new environment type create a new trait with the appropriate Identity and Authenticator types:
trait SessionEnv extends Env { type I = User type A = SessionAuthenticator } trait JWTEnv extends Env { type I = User type A = JWTAuthenticator }
- trait Environment[E <: Env] extends ExecutionContextProvider
Provides the components needed to handle a secured request.
Provides the components needed to handle a secured request.
It's possible to declare different environments for different environment types. The play.silhouette.api.services.IdentityService and the play.silhouette.api.services.AuthenticatorService are bound to the appropriate types defined in the environment type. But the EventBus and the list of RequestProvider instances can be defined as needed for every environment type.
- sealed trait ErrorHandler extends AnyRef
Silhouette error handler.
- class EventBus extends ActorEventBus with SubchannelClassification
An event bus implementation which uses a class based lookup classification.
- trait ExpirableAuthenticator extends Authenticator
An authenticator that may expire.
- final case class HandlerResult[+T](result: Result, data: Option[T] = None) extends Product with Serializable
A result which can transport a result as also additional data through the request handler process.
A result which can transport a result as also additional data through the request handler process.
- T
The type of the data.
- result
A Play Framework result.
- data
Additional data to transport in the result.
- trait Identity extends AnyRef
This trait represents an authenticated user.
- trait Logger extends AnyRef
Implement this to get a named logger in scope.
- final case class LoginEvent[I <: Identity](identity: I, request: RequestHeader) extends SilhouetteEvent with Product with Serializable
An event which will be published after an identity logged in.
An event which will be published after an identity logged in.
- I
The type of the identity.
- identity
The logged in identity.
- request
The request header for the associated request.
- final case class LoginInfo(providerID: String, providerKey: String) extends Product with Serializable
Represents a linked login for an identity (i.e.
Represents a linked login for an identity (i.e. a local username/password or a Facebook/Google account).
The login info contains the data about the provider that authenticated that identity.
- providerID
The ID of the provider.
- providerKey
A unique key which identifies a user on this provider (userID, email, ...).
- final case class LogoutEvent[I <: Identity](identity: I, request: RequestHeader) extends SilhouetteEvent with Product with Serializable
An event which will be published after an identity logged out.
An event which will be published after an identity logged out.
- I
The type of the identity.
- identity
The logged out identity.
- request
The request header for the associated request.
- trait NotAuthenticatedErrorHandler extends ErrorHandler
Handles errors when a user is not authenticated.
- final case class NotAuthenticatedEvent(request: RequestHeader) extends SilhouetteEvent with Product with Serializable
An event which will be published if a request did not pass authentication.
An event which will be published if a request did not pass authentication.
- request
The request header for the associated request.
- trait NotAuthorizedErrorHandler extends ErrorHandler
Handles errors when a user is authenticated but not authorized.
- final case class NotAuthorizedEvent[I <: Identity](identity: I, request: RequestHeader) extends SilhouetteEvent with Product with Serializable
An event which will be published if a request did not pass authorization.
An event which will be published if a request did not pass authorization.
- I
The type of the identity.
- identity
The logged in identity.
- request
The request header for the associated request.
- trait Provider extends AnyRef
A marker interface for all providers.
- trait RequestHandlerBuilder[E <: Env, +R[_]] extends ExecutionContextProvider
Base implementation for building request handlers.
Base implementation for building request handlers.
The base implementations to handle secured endpoints are encapsulated into request handlers which can execute an arbitrary block of code and must return a HandlerResult. This HandlerResult consists of a normal Play result and arbitrary additional data which can be transported out of these handlers.
- E
The type of the environment.
- R
The type of the request.
- trait RequestProvider extends Provider
A provider which can be hooked into a request.
A provider which can be hooked into a request.
It scans the request for credentials and returns the login info for it.
- final case class SignUpEvent[I <: Identity](identity: I, request: RequestHeader) extends SilhouetteEvent with Product with Serializable
An event which will be published after an identity signed up.
An event which will be published after an identity signed up.
- I
The type of the identity.
- identity
The newly created identity.
- request
The request header for the associated request.
- trait Silhouette[E <: Env] extends AnyRef
The Silhouette stack.
The Silhouette stack.
Inject an instance of this trait into your controller to provide all the Silhouette actions.
- E
The type of the environment.
- trait SilhouetteEvent extends AnyRef
The base event.
- class SilhouetteProvider[E <: Env] extends Silhouette[E]
Provides the Silhouette stack.
Provides the Silhouette stack.
- E
The type of the environment.
- trait StorableAuthenticator extends Authenticator
An authenticator which can be stored in a backing store.
Value Members
- object Authenticator
The
Authenticatorcompanion object. - object Authorization
The companion object.
- object Environment
Companion object to easily create environment instances.
Companion object to easily create environment instances.
Environment[SessionEnv](...) Environment[JWTEnv](...)
- object EventBus
A global event bus instance.
- object LoginInfo extends (String, String) => LoginInfo with Serializable
The companion object of the login info.