我有一个使用oauth2进行身份验证的spring启动应用程序.oauth2机制正在运行,客户端可以验证并接收其访问令牌.
我想用httpbasic身份验证来保护执行器端点,即不要求用户首先使用oauth2进行身份验证,然后访问执行器端点.到目前为止我所做的是在属性文件中设置以下内容:
management.context-path=/admin/actuators
management.security.enabled=true
management.security.role=ADMIN
security.user.name=admin
security.user.password=password
Run Code Online (Sandbox Code Playgroud)
我已经尝试了各种方法来使用ResourceServerConfigurerAdapter和WebSecurityConfigurerAdapter设置配置.
我的尝试都没有奏效,它一直在告诉我
<oauth>
<error_description>
Full authentication is required to access this resource
</error_description>
<error>unauthorized</error>
</oauth>
Run Code Online (Sandbox Code Playgroud)
让OAUTH2和管理端点工作的正确方法是什么?
我有一个应用程序配置为在/ manage/health服务Spring Boot Actuator的健康端点.不幸的是,由于我正在部署的基础设施的一些细节,我需要将/和/ health替换为/ manage/health.
我没有看到通过属性自定义健康端点URL的选项.我假设没有办法添加适用于我不拥有的控制器的额外@RequestMapping注释.
我宁愿明确定义所需的别名,而不是一些影响所有流量性能的流量拦截器.对于Spring来说相对较新,我不确定最好的方法是什么,我的搜索不会引导我朝着正确的方向前进.
谁能提供一些方向?
谢谢.