首页 > 解决方案 > jhipster+okta 的授权错误:未添加 ROLE_ADMIN

问题描述

我正在尝试按照本指南使用 okta 设置测试 jhipster Web 应用程序。

我可以使用 okta 使用我的 jhipster Web 应用程序登录,我应该是 ROLE_ADMIN,但是在被重定向回 webapp 菜单后,任何导航到实体的尝试都会导致未授权/拒绝访问页面。

IDE 是 Intellij,构建工具是 gradle。我正在使用 Java SDK 11。

okta 有 ROLE_ADMIN 和 ROLE_USER 组:

在此处输入图像描述

我添加了声明:

在此处输入图像描述

控制台日志:

Enter: add() with argument[s] = [AuditEvent [timestamp=2020-04-25T19:50:39.747921400Z, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
Exit: add() with result = null
WARN 16660 --- [ XNIO-1 task-52] o.z.problem.spring.common.AdviceTraits   : Unauthorized: Full authentication is required to access this resource
WARN 16660 --- [ XNIO-1 task-52] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.springframework.security.authentication.InsufficientAuthenticationException: Full authentication is required to access this resource]

在尝试修复错误时,我已将用户和组添加到应用程序下的分配中:

在此处输入图像描述

但问题仍然存在。

被授权为管理员的修复程序是什么?

标签: spring-bootjhipsterokta

解决方案


更改您的组声称使用“匹配正则表达式”过滤器,它应该可以解决您的问题。

在此处输入图像描述


推荐阅读