What is the use of Authenticate and IdentityService. How are they different?
In my code, I receive a json with username and password. First I create
val credentials: Credentials = Credentials(signinInfo.signinInfo.email, signinInfo.signinInfo.password)
Then I call
val loginInfoFuture: Future[LoginInfo] = credentialsProvider.authenticate(credentials)
and then I call
val userOptionFuture: Future[Option[User]] = silhouette.env.identityService.retrieve(loginInfo)
I am struggling to understand how the flow works internally in
silhouette. How is the username and password information in the message getting validated?
CredentialsProvider seem to do is simply call
def loginInfo(credentials: Credentials): Future[LoginInfo] = Future.successful(LoginInfo(id, credentials.identifier)). So do I really need to call
authenticate? I could just create the
LoginInfo myself in the code.
Could there be a scenario when
authenicate might fail?