Questions tagged [base64url]

Specifically for URL-safe base64 encoding. Uses - and _ instead of, respectively, + and /. Padding with = is optional. Source: https://en.wikipedia.org/wiki/Base64#URL_applications

107 questions
80
votes
2 answers

String based data encoding: Base64 vs Base64url

What is the difference between Base64 and Base64url that I see in things like JSON web tokens?
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
52
votes
12 answers

Decode base64Url in Java

https://web.archive.org/web/20110422225659/https://en.wikipedia.org/wiki/Base64#URL_applications talks about base64Url - Decode a modified Base64 for URL variant exists, where no padding '=' will be used, and the '+' and '/' characters of standard…
ufk
  • 30,912
  • 70
  • 235
  • 386
44
votes
1 answer

How to encode and decode Base64 and Base64Url in Flutter / Dart

I want to encode the following string in Base64Url in Flutter and decode it in on a Dart server. "username:password" How do I do that? And how do I do it in Base64?
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
19
votes
4 answers

How to encode and decode data in base64 and base64URL by using unix commands?

Base64 encode can be achieved by $ echo Some_data_to_be_converted | base64 U29tZV9kYXRhX3RvX2JlIF9jb252ZXJ0ZWQK And Base64 decode can be achieved by $ echo U29tZV9kYXRhX3RvX2JlIF9jb252ZXJ0ZWQK | base64 -d Some_data_to_be_converted How to…
MALATESH K
  • 191
  • 1
  • 1
  • 3
14
votes
1 answer

Why do you use base64 URL encoding with JSON web tokens?

The Scenario: I'm reading about JSON web tokens at this link (https://medium.com/vandium-software/5-easy-steps-to-understanding-json-web-tokens-jwt-1164c0adfcec). It outline how to create a JSON web token, you create a header and a payload, and then…
gkeenley
  • 6,088
  • 8
  • 54
  • 129
5
votes
4 answers

Illegal base64url character: ' ' when getting claims/decode from token Java JWT Spring Boot

When I get some claims from a JWT Token to validate user authentication I get the following error: Illegal base64url character: ' ' Creating a JWT goes completely fine but "decoding" seems to have some issues... I also tried a base64url decoder to…
Ronny Giezen
  • 557
  • 2
  • 10
  • 21
4
votes
2 answers

Could not decode JWT payload from base64

I'm going to decode a JWT token from request header, it looks like…
Ming Hieu
  • 149
  • 3
  • 13
4
votes
2 answers

Java 8 Base64 JWT token into JSON

So, I have done some research on this on the Net and here on StackOverflow, and I have tried many, multiple suggestions that I have found. The problem is that I am logging into one of our Oauth2 services which is working well. I get an Oath2 JWT…
tjholmes66
  • 1,850
  • 4
  • 37
  • 73
3
votes
1 answer

Markdown: How to resize image defined with a base64 data uri

In markdown, I would like to embed a base64 image data uri. ![description](data:image/png;base64, --base64 png--) Is there any way to resize the rendered image in markdown?
gaitat
  • 12,449
  • 4
  • 52
  • 76
3
votes
2 answers

nodejs crypto and CryptoJS giving different base64(sha256(data)) outputs

I have a node server and a react-native app. On the node server, all cryptography is done using the crypto module. On the react-native app, all cryptography is done through the crypto-js library because crypto is not available. I have this sample…
Haardik
  • 185
  • 2
  • 6
3
votes
1 answer

Where does the save name of an image come from when it's src is base64

When an comes from the server the src attribute contains the name of the image when you right-click/"Save image as". If you've created an with a base64 encoding, the src name is not useful.
Scott H
  • 33
  • 4
3
votes
1 answer

Wordpress is removing 'data' attribute from base64 encoded image when using wp_insert_post

Edit 1 This is not about the browser. This happens if I'm not logged in. When I logged in, it works perfectly. Sorry for the rush. I know it strange and doesn't make any sense also hard to explain. As the title said browser causes this problem but…
tpbafk
  • 501
  • 5
  • 26
3
votes
1 answer

Are CSRF tokens base64url encoded?

I'm working on an application that parses a CSRF token from a cookie header. I'd like to know whether CSRF tokens are base64 encoded with URL-safe characters (cf. https://simplycalc.com/base64url-encode.php) so that I can match them with the regular…
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526
2
votes
1 answer

baseurl64 buffer decoding

Can someone explain this behavior? Buffer.from('5d9RAjZ2GCob-86_Ql', 'base64url').toString('base64url') // 5d9RAjZ2GCob-86_Qg Please take a close look at the last character l - g
Ihor Sakailiuk
  • 5,642
  • 3
  • 21
  • 35
2
votes
0 answers

How to change filename of a base64 file, opened in newtab? - JavaScritpt - Json Response

I am currently working on a web page, which gives the possibility of downloading reports in pdf format. The report is generated on the server and the request is made through "Json". Once the response is obtained, the "pdf" document is displayed in a…
gonzo84
  • 21
  • 3
1
2 3 4 5 6 7 8