英文:
OpenIddict doesn't support localization
问题
I found the ABP's OpenIddict doesn't support localization currently, I looked at the history of PR and found there is PR to remove the localization early.
为什么OpenIddict模块移除了本地化?
How to override default message?
如何覆盖默认消息?
英文:
I found the ABP's OpenIddict doesn't support localization currently, I looked at the history of PR and found there is PR to remove the localization early.
Why localization is removed from the OpenIddict module?
How to override default message?
答案1
得分: 2
由于OAuth 2.0规范限制了可用于error
和error_description
参数的字符集,因此从OpenIddict模块中移除了本地化支持:
> A.7. "error" 语法
>
> "error"元素在第4.1.2.1、4.2.2.1、5.2、7.2和8.5节中定义为:
>
> error = 1NQSCHAR
>
> A.8. "error_description" 语法
>
> "error_description"元素在第4.1.2.1、4.2.2.1、5.2和7.2节中定义为:
>
> error-description = 1NQSCHAR
>
> NQSCHAR = %x20-21 / %x23-5B / %x5D-7E
实际上,只能使用US-ASCII的子集会阻止您返回本地化消息(即使是常见于法语的简单重音符号如é
或à
也是非法的),这就是ABP团队决定删除它们的原因:不这样做将使其OpenID Connect实现不符合标准。
英文:
> Why localization is removed from the OpenIddict module?
That's because the OAuth 2.0 specification restricts the charset you're allowed to use for the error
and error_description
parameters:
> A.7. "error" Syntax
>
> The "error" element is defined in Sections 4.1.2.1, 4.2.2.1, 5.2,
> 7.2, and 8.5:
>
> error = 1NQSCHAR
>
> A.8. "error_description" Syntax
>
> The "error_description" element is defined in Sections 4.1.2.1,
> 4.2.2.1, 5.2, and 7.2:
>
> error-description = 1NQSCHAR
> NQSCHAR = %x20-21 / %x23-5B / %x5D-7E
In practice, being able to only use a subset of US-ASCII prevents you from returning localized messages (even simple diacritics like é
or à
- that are common in French - are illegal) and that's why the ABP team decided to remove them: not doing so would have made their OpenID Connect implementation non-standard.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论