OpenIddict不支持本地化。

huangapple go评论52阅读模式
英文:

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.

https://github.com/abpframework/abp/commit/6953e9c8a400925a4c9ef0e823ff3d645856c1dd#diff-dba639ee7aaba84fa06dcba562eb566059e2c1f86cb76481a2d8566fa88f186e

Why localization is removed from the OpenIddict module?

How to override default message?

答案1

得分: 2

由于OAuth 2.0规范限制了可用于errorerror_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 = 1
NQSCHAR
>
> 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 = 1
NQSCHAR

> 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.

huangapple
  • 本文由 发表于 2023年6月15日 16:58:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76480828.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定