pekko/akka-docs/rst/scala/http/routing-dsl/directives/security-directives/extractCredentials.rst
2016-01-14 00:31:03 +01:00

24 lines
700 B
ReStructuredText

.. _-extractCredentials-:
extractCredentials
==================
Signature
---------
.. includecode2:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/SecurityDirectives.scala
:snippet: extractCredentials
Description
-----------
Extracts the potentially present ``HttpCredentials`` provided with the request's ``Authorization`` header,
which can be then used to implement some custom authentication or authorization logic.
See :ref:`credentials-and-timing-attacks-scala` for details about verifying the secret.
Example
-------
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/SecurityDirectivesExamplesSpec.scala
:snippet: 0extractCredentials