Commit Graph

10 Commits

Author SHA1 Message Date
ArfyFR 64bb271b2e Quoted-string Basic realm ctx according to rfc7235
Hi,

I faced some problems with 401 message and an Android client.

It yelded because in the WWW-Authenticate header the
Basic ream=<ctx>
wasn't surrouned by ""

In the https://tools.ietf.org/html/rfc7235 it is written that 
 - Authentication parameters are name=value pairs
 - and "auth-param     = token BWS "=" BWS ( token / quoted-string )"
 - and "For historical reasons, a sender MUST only generate the quoted-string
   syntax.  Recipients might have to support both token and
   quoted-string syntax for maximum interoperability with existing
   clients that have been accepting both notations for a long time."

After my modification, the Android worked again (and iOs and PC clients faicing the 401 still worked ;) )

BR,
Arfy
2016-11-03 11:00:33 +01:00
Igor Ippolitov f824aee3ef files needed for debian packaging and minor changes into rpm spec 2016-11-02 20:06:42 +03:00
Igor Ippolitov 438518509d ensure required parameters are set at the time of a request 2016-11-02 20:06:42 +03:00
Igor Ippolitov 5fec096aa6 added options for commandline 2016-11-02 18:33:15 +03:00
Michał 'rysiek' Woźniak 24bf24ffbb Minor bugfixes: password can now contain colons, log_message uses self.ctx (instead of global ctx, which does not exist) 2016-10-10 21:38:15 +02:00
Vladimir Homutov c61f0137b7 Merge /home/vl/tasks/0216-ldap_auth_lab/src/nginx-ldap-auth 2016-10-10 16:51:28 +03:00
Vladimir Homutov 7f3634bba0 more robust error routine.
self.ctx may be unset in case of bad request or other low-level error.
2016-10-10 16:39:56 +03:00
ArfyFR f57c05388d Use RFC2616 recommandation to reply 401 instead on 403 for auth_failed
Cf https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html ,

401 is for: auth failed... please retry ;)
-----------
10.4.2 401 Unauthorized
 The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity might include relevant diagnostic information. HTTP access authentication is explained in "HTTP Authentication: Basic and Digest Access Authentication" [43].



403 is for: more or less auth shouldn't be repeated
-----------
10.4.4 403 Forbidden
 The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.

Regards,
Pascal
2016-10-10 09:09:05 +02:00
Vladimir Homutov 995d0f8eaa Default binddn is changed to empty string.
This allows to use anonymous bind, if binddn is not provided. Previous
default setting lead to use of unauthenticated bind, which is usually
disabled in LDAP server configurations.
2016-06-28 13:55:13 +03:00
Vladimir Homutov 6a345efd55 Initial commit 2015-06-19 14:13:56 +03:00