2015-05-11 23:05:18 +02:00
|
|
|
.. _-authenticateBasicPFAsync-:
|
|
|
|
|
|
|
|
|
|
authenticateBasicPFAsync
|
2015-10-01 13:25:41 +02:00
|
|
|
========================
|
2015-05-11 23:05:18 +02:00
|
|
|
|
|
|
|
|
Signature
|
|
|
|
|
---------
|
|
|
|
|
|
2015-10-01 13:25:41 +02:00
|
|
|
.. includecode:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/SecurityDirectives.scala#async-authenticator-pf
|
|
|
|
|
|
2015-06-19 15:35:24 +02:00
|
|
|
.. includecode2:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/SecurityDirectives.scala
|
2015-05-11 23:05:18 +02:00
|
|
|
:snippet: authenticateBasicPFAsync
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
-----------
|
2015-10-09 15:19:36 +02:00
|
|
|
Wraps the inner route with Http Basic authentication support using a given ``AsyncAuthenticatorPF[T]``.
|
2015-05-11 23:05:18 +02:00
|
|
|
|
2015-10-01 13:25:41 +02:00
|
|
|
Provides support for handling `HTTP Basic Authentication`_.
|
|
|
|
|
|
2015-10-08 15:20:17 +02:00
|
|
|
Refer to :ref:`-authenticateBasic-` for a detailed description of this directive.
|
2015-10-01 13:25:41 +02:00
|
|
|
|
2015-10-08 15:20:17 +02:00
|
|
|
Its semantics are equivalent to ``authenticateBasicPF`` 's, where not handling a case in the Partial Function (PF)
|
|
|
|
|
leaves the request to be rejected with a :class:`AuthenticationFailedRejection` rejection.
|
2015-10-01 13:25:41 +02:00
|
|
|
|
2015-11-19 11:08:37 +01:00
|
|
|
See :ref:`credentials-and-timing-attacks-scala` for details about verifying the secret.
|
|
|
|
|
|
2015-10-01 13:25:41 +02:00
|
|
|
.. warning::
|
2015-10-08 15:20:17 +02:00
|
|
|
Make sure to use basic authentication only over SSL/TLS because credentials are transferred in plaintext.
|
2015-10-01 13:25:41 +02:00
|
|
|
|
|
|
|
|
.. _HTTP Basic Authentication: https://en.wikipedia.org/wiki/Basic_auth
|
2015-05-11 23:05:18 +02:00
|
|
|
|
|
|
|
|
Example
|
|
|
|
|
-------
|
|
|
|
|
|
2015-09-16 23:50:35 +02:00
|
|
|
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/SecurityDirectivesExamplesSpec.scala
|
2015-10-08 15:20:17 +02:00
|
|
|
:snippet: authenticateBasicPFAsync-0
|