Ultimate Javascript Object Signing and Encryption (JOSE), JSON Web Token (JWT) and Json Web Keys (JWK) Implementation for .NET and .NET Core
921
stars
183
forks
source link
Illegal base64url string! Parameter name: input #213
Open
RushabhJbspl opened 1 year ago
Hello, I am facing "Illegal base64url string! Parameter name: input" error while decoding the token : System.ArgumentOutOfRangeException HResult=0x80131502 Message=Illegal base64url string! Parameter name: input Source=jose-jwt StackTrace: at Jose.Base64Url.Decode(String input) at Jose.JWT.DecodeBytes(String token, Object key, Nullable
1 expectedJwsAlg, Nullable
1 expectedJweAlg, Nullable`1 expectedJweEnc, JwtSettings settings, Byte[] payload) at Jose.JWT.Decode(String token, Object key, JwsAlgorithm alg, JwtSettings settings, String payload)App Code: byte[] secretKey = Encoding.ASCII.GetBytes(Key);
string Response = IsEncrypt ? JWT.Encode(Message, secretKey, JwsAlgorithm.HS256) : JWT.Decode(Message, secretKey, JwsAlgorithm.HS256);