Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Show encoded string of JWT / Crypto.JWT (Pietro Grandinetti)
   2. Re:  Show encoded string of JWT / Crypto.JWT (Pietro Grandinetti)


----------------------------------------------------------------------

Message: 1
Date: Sat, 4 Mar 2023 14:43:06 +0000
From: Pietro Grandinetti <pietro....@hotmail.it>
To: "beginners@haskell.org" <beginners@haskell.org>
Subject: [Haskell-beginners] Show encoded string of JWT / Crypto.JWT
Message-ID:
        
<db9p191mb1514e0c4f1414a2e0a68559bfc...@db9p191mb1514.eurp191.prod.outlook.com>
        
Content-Type: text/plain; charset="iso-8859-1"

Hello-

I am working with this package:
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"

ghci> jwt <- ... -- some code
ghci> :t jwt
jwt :: Either JWTError SignedJWT
ghci> show jwt
"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\"))"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20230304/d30dfcbf/attachment-0001.html>

------------------------------

Message: 2
Date: Sat, 4 Mar 2023 14:46:13 +0000
From: Pietro Grandinetti <pietro....@hotmail.it>
To: "beginners@haskell.org" <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Show encoded string of JWT /
        Crypto.JWT
Message-ID:
        
<db9p191mb151498be6a622e5029e58ae3fc...@db9p191mb1514.eurp191.prod.outlook.com>
        
Content-Type: text/plain; charset="utf-8"

Apologies, forgot to link the package: 
https://hackage.haskell.org/package/jose-0.10/docs/Crypto-JWT.html#t:SignedJWT
________________________________
From: Beginners <beginners-boun...@haskell.org> on behalf of Pietro Grandinetti 
<pietro....@hotmail.it>
Sent: Saturday, March 4, 2023 3:43 PM
To: beginners@haskell.org <beginners@haskell.org>
Subject: [Haskell-beginners] Show encoded string of JWT / Crypto.JWT

Hello-

I am working with this package:
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"

ghci> jwt <- ... -- some code
ghci> :t jwt
jwt :: Either JWTError SignedJWT
ghci> show jwt
"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\"))"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20230304/2e92f5ea/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 170, Issue 2
*****************************************

Reply via email to