Re: [naviserver-devel] ns_conn auth

2020-11-21 Thread Gustaf Neumann
Look at "Authorization: Basic d2lraTpwZWRpYQ==" it is just two tokens, but the content is decoded and returned in the ns_set a user and password. Here is an example of the digest authorization header Authorization: Digest username="Mufasa", realm="testre...@host.com",

Re: [naviserver-devel] ns_conn auth

2020-11-21 Thread Maksym Zinchenko
Gustaf, thank you very much. You are amazing as always. I thought "Authorization" is always kind of key -> pair values, guess I was wrong. I think most of them are so. Thank you. On Sat, Nov 21, 2020 at 7:05 PM Gustaf Neumann wrote: > Dear Maksym, > > [ns_conn auth] handles Digest

Re: [naviserver-devel] ns_conn auth

2020-11-21 Thread Iuri de Araujo Sampaio
There we go! ;) > On Rab. II 6, 1442 AH, at 17:05, Gustaf Neumann wrote: > > Dear Maksym, > > [ns_conn auth] handles Digest authentication (i've never used it), but > "Bearer" is not handled. > The fields in the "Authorization" request header field are not always > structured the same way,

Re: [naviserver-devel] ns_conn auth

2020-11-21 Thread Iuri de Araujo Sampaio
Hi Maksym, Indeed I got it now. And I’m able to replicate your scenario on my end. Unless there's a bug (i.e. malformed list in the ns_auth assignment), it seems ns_set supports only reserved keys for “auth”. So, I believe it’s because NS source only assigns default values (basic headers to

Re: [naviserver-devel] ns_conn auth

2020-11-21 Thread Gustaf Neumann
Dear Maksym, [ns_conn auth] handles Digest authentication (i've never used it), but "Bearer" is not handled. The fields in the "Authorization" request header field are not always structured the same way, so NaviServer tries it interprete it based on the first word. The known types are

Re: [naviserver-devel] ns_conn auth

2020-11-21 Thread Maksym Zinchenko
Hello Iuri, I think you misunderstood my question. My problem is not to set but to get "ns_set" I'm using this: https://naviserver.sourceforge.io/n/naviserver/files/ns_conn.html#4 When client sends request to my server i want to get authentication method using [ *ns_conn auth* ] Here is simple

[naviserver-devel] ns_conn auth

2020-11-21 Thread Maksym Zinchenko
Hello, hope you are doing well. I have a little question. Maybe a bug, would be so kind to help me out. According to documentation [ns_conn auth] should return all authorization headers as a ns_set. It works fine when using "Basic Authentication scheme", i've seen in the source code it should work