【问题标题】:Enable custom error message in Azure app service (Spring boot application)在 Azure 应用服务(Spring 启动应用程序)中启用自定义错误消息
【发布时间】:2021-09-24 23:18:42
【问题描述】:

我在 Spring Boot 应用程序中有一条关于授权失败的自定义错误消息,它在 localhost 中运行良好,但在 azure 中部署时返回如下:

{
    "timestamp": TIMESTAMP,
    "status": 401,
    "error":"unauthorized",
    "message": "unauthorized",
    "path": "/testapplication"
}

【问题讨论】:

    标签: java spring-boot azure


    【解决方案1】:

    目前在 azure App Services 中没有自定义错误消息的功能。为此有一个feature request planned。您可以从那里对其进行后续评论,也可以反馈HERE 以获取功能请求。

    查看以下主题以了解相关对话。

    1. Spring Oauth2 returns 401 Unauthorized error with spring boot 2.0 - Stack Overflow
    2. java - Spring Security - 401 Unauthorized for token end point (/oauth/token) - Stack Overflow
    3. java - Spring Boot 2.0.3 Oauth2 Security: Getting 401 error even when using access token in header - Stack Overflow

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-05
      • 1970-01-01
      • 2018-08-30
      • 2019-06-30
      • 2012-06-12
      • 1970-01-01
      • 2020-06-09
      • 2020-08-14
      相关资源
      最近更新 更多