Please sign in to comment.
! routing: Render `WWW-Authenticate` header also for rejected credent…
…ials, fixes #188 When authentication fails, browsers didn't offer a possibilty to re-enter new credentials because of the missing WWW-Authenticate header. RFC2617 states: "If the origin server does not wish to accept the credentials sent with a request, it SHOULD return a 401 (Unauthorized) response. The response MUST include a WWW-Authenticate header field containing at least one (possibly new) challenge applicable to the requested resource." This patch adds the missing header, so users can attempt again to authenticate themselves. This patch merges the AuthenticationRequiredRejection into the AuthenticationFailedRejection and moves the generation of the headers into the HttpAuthenticator.
- Loading branch information...
Showing with 58 additions and 40 deletions.
- +16 −14 spray-routing-tests/src/test/scala/spray/routing/SecurityDirectivesSpec.scala
- +25 −10 spray-routing/src/main/scala/spray/routing/Rejection.scala
- +7 −6 spray-routing/src/main/scala/spray/routing/RejectionHandler.scala
- +10 −10 spray-routing/src/main/scala/spray/routing/authentication/HttpAuthenticator.scala