pekko/akka-docs-dev/rst/scala/http/routing-dsl/directives/security-directives/extractCredentials.rst
2015-10-12 02:12:26 +02:00

22 lines
611 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.
Example
-------
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/SecurityDirectivesExamplesSpec.scala
:snippet: 0extractCredentials