Hi all, 

I try to use a basic authentication with a "bcrypted" password extracted 
from a database. Unfortunately, the basic authenticationBasicAync directive 
calls the authenticator with a UserCredentials via 
"authenticator(UserCredentials(basic))".

The apply method from the UserCredentials "hides" the comparison in a 
verify method : (see here 
<https://github.com/akka/akka/blob/release-2.3-dev/akka-http/src/main/scala/akka/http/scaladsl/server/directives/SecurityDirectives.scala#L140>
)

def apply(cred: Option[BasicHttpCredentials]): UserCredentials =
    cred match {
      case Some(BasicHttpCredentials(username, receivedSecret)) ⇒
        new UserCredentials.Provided(username) {
          def verifySecret(secret: String): Boolean = secret secure_== 
receivedSecret
        }
      case None ⇒ UserCredentials.Missing
    }

I might be missing something here, but it does not seem possible to provide 
a custom secret verification method. Is there a way to do it ?

NB: I am using akka-http RC3.

Regards, 

Guillaume

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to