-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{"Illegal base64url string! (Parameter 'input')"} #196
Comments
Hi @Jesterbester2 , it doesn't look like your token is JWE? Can you try with |
I have tried both of them and neither work, also from my understanding jwt & Jwe. Jwts are seperated by two periods and JWEs are seperated by 4 periods the token above has 4, and I know for a fact the it was encrypted when it was originally made using JWtauthprovider. |
By the way in case I didn't make it clear I'm trying to get the payload from the token? |
Hi @Jesterbester2 , can you attach your key if possible, so i can run decoding myself? Hard to guess without trying. |
Hey, so i dig around, it seems 2nd part of token is incorrectly base64url encoded, it has wrong padding
you can check it yourself too at https://toolsaday.com/encode-decode/base64Url-decode for instance. @Jesterbester2 where did you get this token from? What library generated it? |
So I'm trying to decrypt a jwe token, with an algorithm of RSA-OAEP, and encryption of A128CBC-HS256
I'm RSA to make a JWK object.
then I trying the code below:
rsa.FromXmlString( // PRIVATE XML STRING KEY );
var jwk= new Jwk(rsa);
JwtSettings settings = new JwtSettings();
settings.Jws(JwsAlgorithm.HS256);
settings.Jwa(JweAlgorithm.RSA_OAEP);
settings.Jwe(JweEncryption.A128CBC_HS256);
var jwe = Jose.JWE.Decrypt(token, jwk, JweAlgorithm.RSA_OAEP, JweEncryption.A128CBC_HS256, settings);
And everytime I try get an exception: {"Illegal base64url string! (Parameter 'input')"}
Below is an example of my token string, is there something I should be doing differently?
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhDQkMtSFMyNTYiLCJraWQiOiJwMTgifQ.JpnQn7b-XJ2E6aBbBI_uF4JBQR7CSZjE8a-xQBwhouM-jUCDP4IjDAM_TtOFqx1NF4etUTJ2aiZC-lB5XqI6Kbe2Alo8NXB16V5OmYj0kJrCL9x6yRFYI9LNsVxhPbV5a-AMdXPaeGaM0-_SRuvT8rtTR8AAsZP9f033jjR4g.ECocleCj4xSGc55bJ54fnw.1X9vLA7NQfOrOh6JZHAPjSSClsZx5kr22-bkcBp5WMzR_9oJesOoIQz7qDI5_75KVkpypbOrWcvFwUy9nQ23aSnPvhOcDNZEPyohOMf0A-28EQ87vNdXY4u5qbeLgMh5FHFkqFdKOoIFTkhnVaDg177thw5ZQ9iTJ0-Ar0j26ZCrerfgcA0OlSlBgWtEPD6QURCBgPMKWE4hAMGR2kyULg3k9FUueugp8BzJUnO2wDiTOpbXThRCFb5aOpjoXw4xf9OYlbuedHkZwYVdbdBC3w.4ZaZxKr-X4TA5ZKsmq2be7m7qCA6482VncSOL7LoVKw
The text was updated successfully, but these errors were encountered: