[OpenSIPS-Users] WWW-Authenticate header Realm extraction

Marwan El-Sadek marwan_sadek at hotmail.com
Thu Jun 28 01:24:46 CEST 2012


Hello Ali,
I don't know how can I do that with avp_check! I need to extract only the realm part value to use it elsewhere!
Regards,Marwan

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------You can use regex and avp_check:

http://www.opensips.org/html/docs/modules/1.8.x/avpops.html#id292733


Regards,
Ali Pey


Date: Wed, 27 Jun 2012 16:06:52 +0000
Subject: Re: RE: [OpenSIPS-Users] WWW-Authenticate header Realm extraction
From: duane.larson at gmail.com
To: marwan_sadek at hotmail.com; duane.larson at gmail.com
CC: users at lists.opensips.org; marwan_sadek at hotmail.com

Ah.  Yeah that would be a problem.

On , Marwan El-Sadek <marwan_sadek at hotmail.com> wrote:
> 
> 
> 
> 
> 
> Hello Duane,
> 
> Thank you for your reply.
> 
> The problem is that the Digest Realm parameter can be at any index in the header, its not always the first parameter. So using the index will not work for all messages!
> 
> Regards,
> Marwan
> 
> 
> 
> Date: Wed, 27 Jun 2012 15:37:42 +0000
> Subject: Re: [OpenSIPS-Users] WWW-Authenticate header Realm extraction
> From: duane.larson at gmail.com
> To: marwan_sadek at hotmail.com
> CC: users at lists.opensips.org; marwan_sadek at hotmail.com
> 
> I think you can accomplish this by using both of these together
> 
> http://www.opensips.org/Resources/DocsCoreVar18#toc93
> $hdr(WWW-Authenticate) 
> 
> http://www.opensips.org/Resources/DocsCoreTran18#toc6
> s.select
> 
> 
> 
> 
> 
> On , Marwan El-Sadek marwan_sadek at hotmail.com> wrote:
> > 
> > 
> > 
> > 
> > Hello,
> > 
> > I'm trying to extract the Realm value from the WWW-Authenticate header of the 401 unauthorized reply, however, I can't find a pseudo-variable for it, so I tried the following:
> > 
> > $var(temp)=$(hdr(WWW-Authenticate){param.value,Realm});
> > 
> > I also tried it with Digest Realm, Digest and "Digest Realm".
> > 
> > The received value in 401 is:
> > 
> > WWW-Authenticate: Digest realm="XXXX",nonce="5e36af",qop="auth"
> > 
> > I'm getting the following error: parse_params: invalid character, ; expected, found r
> > 
> > So think the problems happens because there is a space in the parameter name.
> > 
> > Does anyone know how can I do this?
> > 
> > Thanks,
> > Marwan
> >  		 	   		  
> > 
> > 
> >
>  		 	   		  
> 
> 
> 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120628/93830acd/attachment.htm>


More information about the Users mailing list