java - Jhipster gateway 需要完整的身份验证才能访问此资源
问题描述
大家好,我正在 ubuntu os 上开发 Jhipster。我的项目设置已成功完成。但是在尝试测试 api 时,它给了我身份验证错误。
这是测试 API 时发生的错误。如果有人帮助我,我会很高兴。
错误:
rExceptionResolver : Resolved exception caused by Handler execution: org.springframework.security.authentication.InsufficientAuthenticationException: Full authentication is required to access this resource
网页浏览器
{
"type" : "https://www.jhipster.tech/problem/problem-with-message",
"title" : "Unauthorized",
"status" : 401,
"detail" : "Full authentication is required to access this resource",
"path" : "/api/account",
"message" : "error.http.401"
}
解决方案
在我的情况下(在开发配置文件中),我更新了JWT 令牌,在所有应用程序(微服务、网关和注册表)中更改为 base64,此外,注释旧属性“秘密”并使用相同的密钥。然后正确地从网关测试 API,没有授权问题。
jh 版本 5.7.1
推荐阅读
- cors - 未收到 CORS 请求的原始标头
- r - 无需下载或验证即可阅读已发布的 Google 表格
- r - 使用R解决类似的Excel Goal Seek问题
- linux - 作为 cron 作业运行无法获得输出
- html - 使用 Axios 访问作为 FormData 发送的数据
- r - ggplot `scale_fill_manual()` 无限交替颜色
- anylogic - Anylogic中的路线成本核算
- java - 从 Java 调用 Kotlin 的高阶函数
- sql - 联接 3 个表(或交叉联接?)并输出 2 次 users.name 值
- html - 如何从 HTML 文件中获取带有正则表达式、sed 和 grep 的图像名称