0

I'm trying to implement HTTP Digest authentication in a server based on cpp-netlib and I'm not sure how to tackle the issue that the username attribute in the authorization header could contain unicode symbols - the actual Digest authentication RFC is not specific on this. But practice shows that e.g. Chrome just sends utf-8 encoded username, which would be fine, apart from the fact that cpp-netlib parses the incoming stream and checks if the header contents are alpha numeric using Boost and std::isalnum and friends (ok, on Linux i could just set the current locale to utf-8, but i'm on Windows) and that of course causes assertions and what not. So, I'm just asking for a general opinion, based on the facts given:

1) Should I just dump this (and I'm really close to that) and just use a customized POST/GET for authentication? 2) Can I anyhow customize the Boost's behaivor (since the functions that verify alpha numeric values come form boost\algorithm\string\classification) to tackle this? 3) Maybe such issues are somehow handled in POCO or other web server frameworks that could server as replacements in this situation?

Rudolfs Bundulis
  • 11,636
  • 6
  • 33
  • 71
  • Doesn't windows support `setlocale()`? – jxh Oct 07 '13 at 17:03
  • Well, from here http://msdn.microsoft.com/en-us/library/x99tb11d(v=vs.90).aspx - `The set of available languages, country/region codes, and code pages includes all those supported by the Win32 NLS API except code pages that require more than two bytes per character, such as UTF-7 and UTF-8. If you provide a code page like UTF-7 or UTF-8, setlocale will fail, returning NULL.` – Rudolfs Bundulis Oct 07 '13 at 17:12
  • Looks like you are out of luck. See: http://stackoverflow.com/q/4324542/315052 – jxh Oct 07 '13 at 17:15

0 Answers0