获得对受保护的SwaggerResource的访问权限

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

我一直在通过本示例https://github.com/varghgeorge/microservices-single-swagger进行操作,遇到的问题是我知道我摇摇欲坠的文档的端点,但是为了直接通过浏览器访问它,我需要提供用户名和密码。我想以编程方式执行此操作,以避免出现以下错误。

已作为配置提供,URL完整且带有前置访问凭据:

Errors
Hide
Fetch errorFailed to execute 'fetch' on 'Window': Request cannot be constructed from a URL that includes credentials: https://username:password@my-host/v2/api-docs https://username:password@my-host/v2/api-docs
Fetch errorPossible cross-origin (CORS) issue? The URL origin (https://my-host) does not match the page (http://localhost:8080). Check the server returns the correct 'Access-Control-Allow-*' headers.
authentication swagger springfox
1个回答
0
投票

我遇到了同样的问题,并且解决了它,在我的安全配置中向API项目添加了新的@Bean

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