<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
Apologies, forgot to link the package: <a href="https://hackage.haskell.org/package/jose-0.10/docs/Crypto-JWT.html#t:SignedJWT" id="LPlnk285018">
https://hackage.haskell.org/package/jose-0.10/docs/Crypto-JWT.html#t:SignedJWT</a><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Beginners <beginners-bounces@haskell.org> on behalf of Pietro Grandinetti <pietro.gra@hotmail.it><br>
<b>Sent:</b> Saturday, March 4, 2023 3:43 PM<br>
<b>To:</b> beginners@haskell.org <beginners@haskell.org><br>
<b>Subject:</b> [Haskell-beginners] Show encoded string of JWT / Crypto.JWT</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Hello-</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
I am working with this package: <br>
</div>
<div class="x_elementToProof x_ContentPasted1" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
I created a `SignedJWT` object, but cannot find a way to print it in the standard string form. I mean the string that would be used by clients, for example to send it in the "Authorization: Bearer ..." header of a HTTP request. Like this one: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof x_ContentPasted0" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
ghci> jwt <- ... -- some code<br>
<div class="x_ContentPasted0">ghci> :t jwt</div>
<div class="x_ContentPasted0">jwt :: Either JWTError SignedJWT</div>
<div class="x_ContentPasted0">ghci> show jwt</div>
<div class="x_ContentPasted0">"Right JWS Base64Octets \"{\\\"aud\\\":\\\"bob\\\",\\\"iat\\\":1.677940566501089259e9,\\\"iss\\\":\\\"alice\\\"}\" Identity (Signature Nothing (JWSHeader {_jwsHeaderAlg = HeaderParam () PS512, _jwsHeaderJku = Nothing, _jwsHeaderJwk
= Nothing, _jwsHeaderKid = Nothing, _jwsHeaderX5u = Nothing, _jwsHeaderX5c = Nothing, _jwsHeaderX5t = Nothing, _jwsHeaderX5tS256 = Nothing, _jwsHeaderTyp = Nothing, _jwsHeaderCty = Nothing, _jwsHeaderCrit = Nothing}) (Base64Octets \"\\DC2\\DC4\\151`\\131\\229j\\SI,\\178-\\CAN\\191UV-\\191u\\160\\217\\NAK\\247a\\150\\159\\195\\141=\\176\\212\\197\\209\\&8u+\\SIn\\DLE]\\167\\153\\SO\\142t\\163^\\EMW\\NAKt\\252\\b\\142j\\209^\\169j\\180
/U*^\\184\\t\\ESC\\DC4:\\DC4\\191\\150\\150\\192\\145\\FS\\172W!\\197\\190\\193\\RSx\\216\\244\\188\\168\\141\\213|\\EM\\174\\219\\230\\130b\\157\\130:\\b)\\n\\158\\169\\228?\\179\\177\\188\\234[N3\\ETX\\162\\230C\\167\\130V'V\\246\\240\\193\\243@\\SYN\\GS\\228\\157\\248\\161{\\131\\204=fI\\SYN\\GSZ\\149\\&8\\139\\a\\153\\a3\\nt\\185\\222\\&4\\FS\\EM\\171\\NUL2\\GS\\211,8CE(\\230\\240j\\150\\253\\204\\255\\188\\141\\250-:\\ESCx;3\\163K7\\137>\\145\\&0\\186\\194U0;\\b\\206\\221)C\\SOHX\\233?\\160\\168VqY\\160\\218\\&1\\224v\\f\\215[\\n\\231\\243a>\\212\\241\\237b\\138\\251eb\\207\\217\\t\\NUL\\138\\DC3\\184\\142I\\132\\154\\213\\139\\171\\137\\214\\ETX\\250\\198xn\\GS\\137\\182\\161b\\183\\f\\195\\231(\\202\\196\\177\\SI\\222\\193\\245Dv\\199\\156\\239D\\181.\\189\\153\\EOT\\SUB\\158\\160x\\135\\169$\\226\\DC3\\132\\198\\204$\\229\\&2ZTaG\\168\\203\\188\\v\\250\\SI\\214\\176;xkx\\170C\\DLE\\228\\NULc\\200r-\\205z\\243\\246\\NUL\\212Qx\\DLE!\\182\\188^\\STX\\244@\\252\\SI\\253_L\\165\\128g\\136\\197\\NUL\\201Cb\\vm\\238_>}F6\\193[As\\v\\222\\209\\146\\206\\215\\174\\&9\\NAK`E\\253\\199\\237\\236'\\149o9\\141\\130\\138\\DEL;\\NAK\\ESC\\225\\189\\170\\&1\\SUB\\CAN\\178U\\ETBL\\216G\\251\\218\\137\\191\\SYN\\193(\\DC4q\\196T\\174>@y\\198\\&4R\\138\\155~H\\DEL\\135\\202\\236\\&0\\219\\136r\\ETX\\138\\174js\\192^\\238\\193L\\204|x\\170\\140B\\158\\f\\164>2\\166\\156*W\\\\\\130\\160*\\230a\\DC3\\173m'\\DELm\\FSS[?6\\206\\170\\ESC\\145MKS=\\164Ec0\\EM\\177\\&4whq\\194\\ACKM\\147\\210\\183\\228\\161\\136\\162{\\166\\226\\174g\\241\\210\\223b\\190\\&5\\229\\212\"))"</div>
<br>
</div>
</div>
</body>
</html>