ASP.NET Core 身份重置密码令牌在 IIS 服务器中无效

问题描述 投票:0回答:1

我正在尝试使用 .NET Core 身份重置密码。这就是我生成密码重置令牌并将其作为电子邮件发送的原因。系统在本地主机上运行良好,但将其上传到 IIS 服务器后,会抛出“无效令牌”错误

enter image description here

enter image description here

你能帮我吗?

谢谢你

asp.net-core token asp.net-core-identity reset-password
1个回答
0
投票

我解决了我的问题 问题的原因是我用来编码令牌的方法。 我改变了我的编码解码方法

--编码-- byte[] tokenGenerateBytes = Encoding.UTF8.GetBytes(resetToken); var codeEncoded = WebEncoders.Base64UrlEncode(tokenGenerateBytes);

--解码-- var codeDecodedBytes = WebEncoders.Base64UrlDecode(codeEncoded ); var codeDecoded = Encoding.UTF8.GetString(codeDecodedBytes);

© www.soinside.com 2019 - 2024. All rights reserved.