2015-05-11 23:05:18 +02:00
|
|
|
.. _-extractCredentials-:
|
|
|
|
|
|
|
|
|
|
extractCredentials
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
Signature
|
|
|
|
|
---------
|
|
|
|
|
|
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: extractCredentials
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
-----------
|
|
|
|
|
|
2015-10-01 13:25:41 +02:00
|
|
|
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.
|
2015-05-11 23:05:18 +02:00
|
|
|
|
2015-11-19 11:08:37 +01:00
|
|
|
See :ref:`credentials-and-timing-attacks-scala` for details about verifying the secret.
|
|
|
|
|
|
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-05-11 23:05:18 +02:00
|
|
|
:snippet: 0extractCredentials
|