C
C#3w ago
Alex

✅ Malformed input: 321 is an invalid input length

I'm working with Asp.Net Core Identity. I use GeneratePasswordResetTokenAsync(user) to generate token and encode it with WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(token));. Next I decode encoded token with Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(encodedToken)) and get exception:
An unhandled exception occurred while processing the request.
FormatException: Malformed input: 321 is an invalid input length.
Microsoft.AspNetCore.WebUtilities.WebEncoders.GetNumBase64PaddingCharsToAddForDecode(int inputLength)
An unhandled exception occurred while processing the request.
FormatException: Malformed input: 321 is an invalid input length.
Microsoft.AspNetCore.WebUtilities.WebEncoders.GetNumBase64PaddingCharsToAddForDecode(int inputLength)
How can I fix my problem?
0 Replies
No replies yetBe the first to reply to this messageJoin