<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">I observed a similar behavior, but it was the result of my cutting and pasting the identity header from sngrep, which looks to have dropped a few bytes on the line break. Any chance that’s what you’re doing, too?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">Ben Kaufman</span></b><span style="font-size:12.0pt;color:black"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal"><i><span style="font-size:10.0pt;color:black">Sr. VoIP Engineer</span></i><span style="font-size:10.0pt;color:black"><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:12.0pt">
<td style="padding:0in 0in 0in 0in;height:12.0pt"></td>
</tr>
<tr>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;color:black">P: <o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;color:black">E: <a href="mailto:bkaufman@nexvortex.com">
bkaufman@nexvortex.com</a><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="font-size:10.0pt;color:black">24 hour client support:
<a href="tel:+18556396300">855.639.6300</a><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:6.0pt">
<td style="padding:0in 0in 0in 0in;height:6.0pt"></td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> <b>
On Behalf Of </b>Daniel W. Graham<br>
<b>Sent:</b> Wednesday, June 30, 2021 10:31 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>; David Villasmil <david.villasmil.work@gmail.com>; Daniel-Constantin Mierla <miconda@gmail.com><br>
<b>Subject:</b> Re: [SR-Users] SECSIPID Identity Decode<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Here is an example, payload taken from Identity header.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Identity was added with secsipid_add_identity<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Payload test:<o:p></o:p></p>
<p class="MsoNormal">$var(test) = "eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6I5ODkyODkyMjgwIl19LCJpYXQiOjE2MjUxMDk2MzQsIm9yaWciOnsidG4iOiI5ODk0MDA0MjMwIn0sIm9yaWdpZCI6IjNmYmE4NTg0LTRkNzMtNGU2NC04NDc5LTQ5MjU2ZGIyMWFhYSJ9";<o:p></o:p></p>
<p class="MsoNormal">xlogl("L_WARN", "$(var(test){s.decode.base64t})\n");<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Result is:<o:p></o:p></p>
<p class="MsoNormal">{"attest":"A","dest":{"tn":#<span style="font-family:"Tahoma",sans-serif">���</span>#<span style="font-family:"Tahoma",sans-serif">��</span>##<span style="font-family:"Tahoma",sans-serif">�</span>#002%<span style="font-family:"Tahoma",sans-serif">���</span>&<span style="font-family:"Tahoma",sans-serif">�</span>#027B#<span style="font-family:"Tahoma",sans-serif">�</span>#023c#S#023#003<span style="font-family:"Tahoma",sans-serif">�</span>#023sB<span style="font-family:"Tahoma",sans-serif">�</span>&<span style="font-family:"Tahoma",sans-serif">�</span>&<span style="font-family:"Tahoma",sans-serif">�</span>r#<span style="font-family:"Tahoma",sans-serif">��</span>'F<span style="font-family:"Tahoma",sans-serif">�</span>#<span style="font-family:"Tahoma",sans-serif">�</span>#<span style="font-family:"Tahoma",sans-serif">���</span>C#003#003C#3#002'<span style="font-family:"Tahoma",sans-serif">��</span>&<span style="font-family:"Tahoma",sans-serif">�</span>&<span style="font-family:"Tahoma",sans-serif">�</span>v<span style="font-family:"Tahoma",sans-serif">�</span>B#<span style="font-family:"Tahoma",sans-serif">�</span>Vc<span style="font-family:"Tahoma",sans-serif">�</span>s#006f"<span style="font-family:"Tahoma",sans-serif">�</span>&6#026#022<span style="font-family:"Tahoma",sans-serif">�</span>CVCB<span style="font-family:"Tahoma",sans-serif">�</span>#023c3#022<span style="font-family:"Tahoma",sans-serif">�</span>3#0066#<span style="font-family:"Tahoma",sans-serif">�</span>#026#6#026S<span style="font-family:"Tahoma",sans-serif">�</span>r'<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">-dan<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org">sr-users-bounces@lists.kamailio.org</a>> on behalf of Daniel Graham
<<a href="mailto:dan@cmsinter.net">dan@cmsinter.net</a>><br>
<b>Reply-To: </b>"Kamailio (SER) - Users Mailing List" <<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>><br>
<b>Date: </b>Wednesday, June 30, 2021 at 5:32 PM<br>
<b>To: </b>David Villasmil <<a href="mailto:david.villasmil.work@gmail.com">david.villasmil.work@gmail.com</a>>, "<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>" <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>>, "Kamailio (SER) - Users Mailing
List" <<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>><br>
<b>Subject: </b>Re: [SR-Users] SECSIPID Identity Decode<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">That’s the same way I am doing it, I was just trying to do a verification that the identity header/payload was correct before activating new changes.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I will do further testing and share results. Just found it odd that the header would decode but payload wouldn’t.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">Daniel W. Graham, CTO<o:p></o:p></p>
<p class="MsoNormal">CMSInter.net LLC<o:p></o:p></p>
<p class="MsoNormal">DIRECT (989) 400-4230<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">INTERNET | TELEPHONE | MANAGED IT<o:p></o:p></p>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">David Villasmil <<a href="mailto:david.villasmil.work@gmail.com">david.villasmil.work@gmail.com</a>><br>
<b>Date: </b>Wednesday, June 30, 2021 at 4:06 PM<br>
<b>To: </b>"<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>" <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>>, "Kamailio (SER) - Users Mailing List" <<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>><br>
<b>Cc: </b>Daniel Graham <<a href="mailto:dan@cmsinter.net">dan@cmsinter.net</a>><br>
<b>Subject: </b>Re: [SR-Users] SECSIPID Identity Decode</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I DO IT WITH: <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"># Break JWT<br>
$var(jwt1) = $(hdr(Identity){s.select,0,.}{s.decode.base64t});<br>
$var(jwt2) = $(hdr(Identity){s.select,1,.}{s.decode.base64t});<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<p class="MsoNormal">David Villasmil <o:p></o:p></p>
<div>
<p class="MsoNormal">email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">
david.villasmil.work@gmail.com</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">phone: +34669448337<o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">On Wed, Jun 30, 2021 at 8:48 PM Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<p>Hello,<o:p></o:p></p>
<p>not familiar with python functions, have you tried with Kamailio transformation?<o:p></o:p></p>
<p><a href="https://www.kamailio.org/wiki/cookbooks/5.5.x/transformations#sdecodebase64url" target="_blank">https://www.kamailio.org/wiki/cookbooks/5.5.x/transformations#sdecodebase64url</a><o:p></o:p></p>
<p>Maybe you have to specify in Python that it is ASCII, I remember I had to do decoding when porting kamcli to work with Python3 -- had to change from using directly the variables received as parameter to a decoded value, something like:<o:p></o:p></p>
<p>prefix = tprefix.encode("ascii", "ignore").decode()<o:p></o:p></p>
<p>Also, if you can, share the identity header here to test with and see if can be reproduced.<o:p></o:p></p>
<p>Cheers,<br>
Daniel<o:p></o:p></p>
<div>
<p class="MsoNormal">On 30.06.21 21:14, Daniel W. Graham wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I am unable to base64url decode the json payload in identity header generated by secsipid.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">(Using python for test)<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">decoded_payload = url64.decode(‘payload’)<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc2 in position 27: invalid continuation byte<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Header decodes fine this way but not payload.
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Is this an issue with the payload encoding?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Kamailio 5.5<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Daniel W. Graham, CTO<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">CMSInter.net LLC<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">DIRECT (989) 400-4230<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">INTERNET | TELEPHONE | MANAGED IT<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<o:p></o:p></p>
<pre>__________________________________________________________<o:p></o:p></pre>
<pre>Kamailio - Users Mailing List - Non Commercial Discussions<o:p></o:p></pre>
<pre> * <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><o:p></o:p></pre>
<pre>Important: keep the mailing list in the recipients, do not reply only to the sender!<o:p></o:p></pre>
<pre>Edit mailing list options or unsubscribe:<o:p></o:p></pre>
<pre> * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></pre>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre>Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">www.asipto.com</a><o:p></o:p></pre>
<pre><a href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a><o:p></o:p></pre>
</div>
<p class="MsoNormal">__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
* <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
* <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</body>
</html>