[SR-Users] SECSIPID Identity Decode
David Villasmil
david.villasmil.work at gmail.com
Wed Jun 30 22:06:32 CEST 2021
I DO IT WITH:
# Break JWT
$var(jwt1) = $(hdr(Identity){s.select,0,.}{s.decode.base64t});
$var(jwt2) = $(hdr(Identity){s.select,1,.}{s.decode.base64t});
Regards,
David Villasmil
email: david.villasmil.work at gmail.com
phone: +34669448337
On Wed, Jun 30, 2021 at 8:48 PM Daniel-Constantin Mierla <miconda at gmail.com>
wrote:
> Hello,
>
> not familiar with python functions, have you tried with Kamailio
> transformation?
>
>
> https://www.kamailio.org/wiki/cookbooks/5.5.x/transformations#sdecodebase64url
>
> 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:
>
> prefix = tprefix.encode("ascii", "ignore").decode()
>
> Also, if you can, share the identity header here to test with and see if
> can be reproduced.
>
> Cheers,
> Daniel
> On 30.06.21 21:14, Daniel W. Graham wrote:
>
> I am unable to base64url decode the json payload in identity header
> generated by secsipid.
>
>
>
> (Using python for test)
>
> decoded_payload = url64.decode(‘payload’)
>
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc2 in position 27:
> invalid continuation byte
>
>
>
> Header decodes fine this way but not payload.
>
>
>
> Is this an issue with the payload encoding?
>
>
>
> Kamailio 5.5
>
>
>
> Daniel W. Graham, CTO
>
> CMSInter.net LLC
>
> DIRECT (989) 400-4230
>
>
>
> INTERNET | TELEPHONE | MANAGED IT
>
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
> * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the sender!
> Edit mailing list options or unsubscribe:
> * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
> * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
> * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210630/c52bfa7d/attachment.htm>
More information about the sr-users
mailing list