class CredentialsProvider extends PasswordProvider
A provider for authenticating with credentials.
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
- CredentialsProvider
- PasswordProvider
- ExecutionContextProvider
- Provider
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new CredentialsProvider(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
- CredentialsProvider → PasswordProvider
- def authenticate(credentials: Credentials): Future[LoginInfo]
Authenticates a user with its credentials.
Authenticates a user with its credentials.
- credentials
The credentials to authenticate with.
- returns
The login info if the authentication was successful, otherwise a failure.
- 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
- CredentialsProvider → ExecutionContextProvider
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- 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
- def loginInfo(credentials: Credentials): Future[LoginInfo]
Gets the login info for the given credentials.
Gets the login info for the given credentials.
Override this method to manipulate the creation of the login info from the credentials.
By default the credentials provider creates the login info with the identifier entered in the form. For some cases this may not be enough. It could also be possible that a login form allows a user to log in with either a username or an email address. In this case this method should be overridden to provide a unique binding, like the user ID, for the entered form values.
- credentials
The credentials to authenticate with.
- returns
The login info created from the credentials.
- 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
- CredentialsProvider → 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)