jhipster+okta的授权错误。未添加ROLE_ADMIN

问题描述 投票:0回答:1

我正在尝试用okta安装一个测试jhipster的网络应用,如下所示。指南.

我可以用okta登录我的jhipster web应用,而且我应该是ROLE_ADMIN,但在被重定向回webapp菜单后,任何试图导航到实体的尝试都会出现一个未授权访问被拒绝的页面。

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

okta有ROLE_ADMIN和ROLE_USER组。

enter image description here

我已经添加了索赔。

enter image description here

控制台日志

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]

为了解决这个错误,我把用户和组都添加到了应用程序下的任务中。

enter image description here

但问题依然存在

有什么办法可以解决这个问题,以ADMIN的身份进行授权?

spring-boot jhipster okta
1个回答
3
投票

将您的组主张改为使用 "匹配regex "的过滤器,应该可以解决您的问题。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.