java - 如何在 Spring Boot 应用程序中验证 swagger ui 中的 api
问题描述
我已经使用Oauth2(密码流)编写了一个 Spring Boot 应用程序,我希望无需访问令牌即可访问 Swagger UI 中的 API。我怎样才能做到这一点?
解决方案
您应该允许 Swagger-Ui 相关路径,以便在您的安全配置中执行此操作,请允许这些路径
.antMatchers(
"/v2/api-docs",
"/swagger-resources",
"/swagger-resources/configuration/ui",
"/swagger-resources/configuration/security")
.permitAll()
推荐阅读
- json - 如何使用filebeat读取json文件并通过logstash发送到elasticsearch
- python - 如何在不使用 manage.py createsuperuser commad 的情况下以编程方式在 docker 中为 django 创建超级用户?
- jquery - 如何将jquery值发送到coldfusion变量中
去表演 ? - python - ValueError:[E024] 找不到监督解析器的最佳移动
- nginx - Ngnix 使用参数将子域掩码为来自另一个子域的 URL
- ssh - Pycharm 无法完成更新骨架
- python - 在 Python 中,我想编写代码,以便如果用户键入我的列表不止一次的单词,则列表中的两个字符串都会被取出
- python - 如何识别每人每次变量的变化(在面板数据中)?
- python-2.7 - Python 2 中的 simpledialog 模块中的属性错误
- npm - NPM : 创建一个 NPM 包,将文件和文件夹添加到项目根目录