Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ trait SecurityDirectives {
* The given authenticator determines whether the credentials in the request are valid
* and, if so, which user object to supply to the inner route.
*
* If no `Authorization: Bearer <token>` header is present, this directive falls back to
* extracting the token from the `access_token` query parameter. Per RFC 6750 Section 2.3,
* bearer tokens transmitted via query parameters may be leaked in server logs, browser history,
* HTTP Referer headers, and proxy logs. For browser-facing APIs, prefer requiring the
* `Authorization` header.
*
* @group security
*/
def authenticateOAuth2[T](realm: String, authenticator: Authenticator[T]): AuthenticationDirective[T] =
Expand All @@ -152,6 +158,12 @@ trait SecurityDirectives {
* The given authenticator determines whether the credentials in the request are valid
* and, if so, which user object to supply to the inner route.
*
* If no `Authorization: Bearer <token>` header is present, this directive falls back to
* extracting the token from the `access_token` query parameter. Per RFC 6750 Section 2.3,
* bearer tokens transmitted via query parameters may be leaked in server logs, browser history,
* HTTP Referer headers, and proxy logs. For browser-facing APIs, prefer requiring the
* `Authorization` header.
*
* @group security
*/
def authenticateOAuth2Async[T](realm: String, authenticator: AsyncAuthenticator[T]): AuthenticationDirective[T] =
Expand Down Expand Up @@ -180,6 +192,9 @@ trait SecurityDirectives {
* The given authenticator determines whether the credentials in the request are valid
* and, if so, which user object to supply to the inner route.
*
* Falls back to extracting the token from the `access_token` query parameter if no
* `Authorization` header is present. See [[authenticateOAuth2]] for security considerations.
*
* @group security
*/
def authenticateOAuth2PF[T](realm: String, authenticator: AuthenticatorPF[T]): AuthenticationDirective[T] =
Expand All @@ -190,6 +205,9 @@ trait SecurityDirectives {
* The given authenticator determines whether the credentials in the request are valid
* and, if so, which user object to supply to the inner route.
*
* Falls back to extracting the token from the `access_token` query parameter if no
* `Authorization` header is present. See [[authenticateOAuth2]] for security considerations.
*
* @group security
*/
def authenticateOAuth2PFAsync[T](realm: String, authenticator: AsyncAuthenticatorPF[T]): AuthenticationDirective[T] =
Expand Down