class BasicAuthProvider extends RequestProvider with PasswordProvider with api.Logger
A request provider implementation which supports HTTP basic authentication.
The provider supports the change of password hashing algorithms on the fly. Sometimes it may be possible to change the hashing algorithm used by the application. But the hashes stored in the backing store can't be converted back into plain text passwords, to hash them again with the new algorithm. So if a user successfully authenticates after the application has changed the hashing algorithm, the provider hashes the entered password again with the new algorithm and stores the auth info in the backing store.
- Alphabetic
- By Inheritance
- BasicAuthProvider
- Logger
- PasswordProvider
- ExecutionContextProvider
- RequestProvider
- Provider
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new BasicAuthProvider(authInfoRepository: AuthInfoRepository, passwordHasherRegistry: PasswordHasherRegistry)(implicit executionContext: ExecutionContext)
- authInfoRepository
The auth info repository.
- passwordHasherRegistry
The password hashers used by the application.
- executionContext
The execution context to handle the asynchronous operations.
- Annotations
- @Inject()
Type Members
- case class InvalidPassword(error: String) extends State with Product with Serializable
Indicates that the entered password doesn't match with the stored one.
Indicates that the entered password doesn't match with the stored one.
- Definition Classes
- PasswordProvider
- case class NotFound(error: String) extends State with Product with Serializable
Indicates that no password info was stored for the login info.
Indicates that no password info was stored for the login info.
- Definition Classes
- PasswordProvider
- sealed trait State extends AnyRef
The authentication state.
The authentication state.
- Definition Classes
- PasswordProvider
- case class UnsupportedHasher(error: String) extends State with Product with Serializable
Indicates that the stored password cannot be checked with the registered hashers.
Indicates that the stored password cannot be checked with the registered hashers.
- Definition Classes
- PasswordProvider
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
- val authInfoRepository: AuthInfoRepository
The auth info repository.
The auth info repository.
- Attributes
- protected
- Definition Classes
- BasicAuthProvider → PasswordProvider
- def authenticate[B](request: Request[B]): Future[Option[LoginInfo]]
Authenticates an identity based on credentials sent in a request.
Authenticates an identity based on credentials sent in a request.
- B
The type of the body.
- request
The request.
- returns
Some login info on successful authentication or None if the authentication was unsuccessful.
- Definition Classes
- BasicAuthProvider → RequestProvider
- def authenticate(loginInfo: LoginInfo, password: String): Future[State]
Authenticates a user
Authenticates a user
- loginInfo
The login info to search the password info for.
- password
The user password to authenticate with.
- returns
The authentication state.
- Definition Classes
- PasswordProvider
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit val executionContext: ExecutionContext
The execution context to handle the asynchronous operations.
The execution context to handle the asynchronous operations.
- Definition Classes
- BasicAuthProvider → ExecutionContextProvider
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def getCredentials(request: RequestHeader): Option[Credentials]
Encodes the credentials.
Encodes the credentials.
- request
Contains the colon-separated name-value pairs in clear-text string format
- returns
The users credentials as plaintext
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def id: String
Gets the provider ID.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val logger: api.Logger
A named logger instance.
A named logger instance.
- Definition Classes
- Logger
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- val passwordHasherRegistry: PasswordHasherRegistry
The password hashers used by the application.
The password hashers used by the application.
- Attributes
- protected
- Definition Classes
- BasicAuthProvider → PasswordProvider
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- case object Authenticated extends State with Product with Serializable
Indicates that the authentication was successful.
Indicates that the authentication was successful.
- Definition Classes
- PasswordProvider
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)