Is there any localization support available in spring-security-oauth2?

时间:2017-07-12 08:04:02

标签: spring-security spring-security-oauth2

Spring-security provides support for localization. https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#localization I am looking for similar option for oauth2.

I have implemented token based authorization using spring-security-oauth2. Is there any support for localization in spring-security-oauth2 or please suggest me any other option?

I have checked official document but did not find anything on that.

For example I am getting below messages based on the scenarios, I want to provide localize support those messages.

{
    "error": "invalid_token",
    "error_description": "7896d62f-04ce-42ad-b7bc-bd2436b73f8b"
}

{
    "error": "invalid_token",
    "error_description": "Token was not recognised"
}

{
    "error": "invalid_grant",
    "error_description": "Bad credentials"
}

1 个答案:

答案 0 :(得分:0)

不幸的是,OpenID Connect规范指出:

error_description

可选。可读的ASCII文本编码错误描述。

因此,本地化将不得不使用其他字段或机制。