ALMA
August 23, 2022, 2:41pm
1
Hi,
I wanted to know in what format are these data?
I have verified that almost all of this content is in Base64 format, but I am not sure.
ZGF0YSI6eyJlbnZpcm9ubWVudCI6InByb2R1Y3Rpb24iLCJtYXJrZXQiOiJlbWVhIiwidmVyc2lvbiI6Miwibm9uY2UiOiIwYzFkNWM5OS04NWIzLTQ2NmYtYTU0NS05ZmZjMDIwZTkxN2EiLCJpc3N1ZWRUaW1lc3RhbXAiOjE2NjAzODUxMTQ2MzV9LCJwZXJtaXNzaW9ucyI6WzUsN10sInRva2VuX3R5cGUiOiJhY2Nlc3MiLCJlbnZpcm9ubWVudCI6InByb2R1Y3Rpb24iLCJtYXJrZXQiOiJlbWVhIiwidmVyc2lvbiI6Mn19.oftwmjV5CMp2NiS2EiVn–v6n6Q_lurSD8ri-Mbz3Vk
Error
August 24, 2022, 1:29am
2
This is base64 format . Decode it to see the result
ALMA
August 24, 2022, 11:01am
3
My doubt is that the final result contains characters that I don’t understand. I don’t know if they will be encrypted again.
aren’t you missing some data before ZGF…?
I"m guessing that the decoded string should start with {“data”:{
ALMA
August 25, 2022, 9:32am
5
You are absolutely right but there is data that I have to censor. In any case, the string always ends with some characters that I don’t understand. Here is the complete string and I don’t know how to enter it in OB2.
the last part will be the JWT signature:
see https://jwt.io/introduction
ALMA
August 25, 2022, 8:20pm
7
I guess it will not be possible to get the JWT signature in OB2
Error
August 26, 2022, 1:18am
8
Jwt as none other than. Hmac + base64 encode that’s it. Find the hmac body and key to make the signature and encode it to b64.
ALMA
August 26, 2022, 11:49am
9
I want to implement through OB2 what the page JSON Web Tokens - jwt.io does. I manage to encode both the Header and the Payload but I don’t know how to verify the signature.
The code that I have come to do is the following:
BLOCK:UTF8ToBase64
LABEL:UTF8 => Base64 (HEADER)
input = “{"alg":"HS256","typ":"JWT"}”
=> VAR @HEADER
ENDBLOCK
BLOCK:UTF8ToBase64
LABEL:UTF8 => Base64 (PAYLOAD)
input = “{"sub":"1234567890","name":"John Doe","iat":1516239022}”
=> VAR @PAYLOAD
ENDBLOCK
BLOCK:Replace
LABEL:Replace(PAYLOAD2)
original = @PAYLOAD
toReplace = “==”
=> VAR @PAYLOAD2
ENDBLOCK
BLOCK:ByteArrayToBase64String
LABEL:Bytes => Base64 (HEADER2)
bytes = @HEADER
urlEncoded = True
=> VAR @HEADER2
ENDBLOCK
BLOCK:ByteArrayToBase64String
LABEL:Bytes => Base64 (PAYLOAD3)
bytes = @PAYLOAD2
urlEncoded = True
=> VAR @PAYLOAD3
ENDBLOCK
I don’t know how to do this:
HMACSHA256(
base64UrlEncode(header) + “.” +
base64UrlEncode(payload),
your-256-bit-secret)
Error
August 27, 2022, 1:22am
10
First read ,what as signature on docs . Google it
ALMA
August 27, 2022, 3:59pm
11
It’s going to be hard to find the final solution to make it work in OB2 but I’ll give it a try. Thank you very much for your advice.