<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>not familiar with python functions, have you tried with Kamailio
      transformation?</p>
    <p><a class="moz-txt-link-freetext" href="https://www.kamailio.org/wiki/cookbooks/5.5.x/transformations#sdecodebase64url">https://www.kamailio.org/wiki/cookbooks/5.5.x/transformations#sdecodebase64url</a></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:</p>
    <p>prefix = tprefix.encode("ascii", "ignore").decode()</p>
    <p>Also, if you can, share the identity header here to test with and
      see if can be reproduced.<br>
    </p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 30.06.21 21:14, Daniel W. Graham
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:C858303C-F7CE-4216-B934-5B823AE32683@exchange.intra.cmsinter.net">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@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:"Segoe UI Historic";
        panose-1:2 11 5 2 4 2 4 2 2 3;}@font-face
        {font-family:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Segoe UI Historic",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}div.WordSection1
        {page:WordSection1;}</style>
      <div class="WordSection1">
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif">I am unable to base64url decode
            the json payload in identity header generated by secsipid.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif">(Using python for test)<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif">decoded_payload =
            url64.decode(‘payload’)<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif">UnicodeDecodeError: 'utf-8' codec
            can't decode byte 0xc2 in position 27: invalid continuation
            byte<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif">Header decodes fine this way but
            not payload.
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif">Is this an issue with the payload
            encoding?<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif">Kamailio 5.5<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:"Segoe UI
            Historic",sans-serif"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Daniel W.
            Graham, CTO<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">CMSInter.net
            LLC<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">DIRECT (989)
            400-4230<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">INTERNET |
            TELEPHONE | MANAGED IT<o:p></o:p></span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
  </body>
</html>