[SR-Users] consume_credentials question

Aymeric Moizard amoizard at gmail.com
Wed Mar 7 14:19:07 CET 2018


Tks Daniel,

The trick worked!
Regards
Aymeric


2018-03-06 15:26 GMT+01:00 Daniel-Constantin Mierla <miconda at gmail.com>:

> Hello,
>
> On 02.03.18 12:28, Aymeric Moizard wrote:
>
>
> Hi list!
>
> I'm trying to remove Proxy-Authorization dedicated
> to local subscriber without -and not the other ones
> dedicated to other server-
>
> I realized that "consume_credentials" doesn't work
> because it requires that a call to "www_authorize,
> proxy_authorize, www_authenticate or proxy_authenticate"
> has been made before. I have a use-case where this isn't
> called.
>
> I don't want to use such code:
>
> if (is_present_hf("Proxy-Authorization")) {
> 	remove_hf("Proxy-Authorization");
> }
>
> Because this may remove a "Proxy-Authorization"
> for another service.
>
> I have seen this: has_credentials but it doesn't help
> to know which header is the one containing the header...
>
> Any good way to find the header and index?
> And then remove it with remove _hf_value2?
>
> I haven't looked for the options offered by the textopsx module, being
> added by ser devs in the past, but if your case of not doing
> www/proxy_authenticate() or auth_check() is to avoid a database query, then
> do pv_auth_check(...) with a random password and the proper relam. Ignore
> the result, the header is parsed, even if authentication fails, and you
> should be able to use consume_credentials().
>
> Cheers,
> Daniel
>
> --
> Daniel-Constantin Mierlawww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
> Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com
>
>


-- 
Antisip - http://www.antisip.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180307/34e854c8/attachment.html>


More information about the sr-users mailing list