401错误,在用户名/密码正确的情况下M子

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

我正在尝试使用邮递员来调用已与Mule一起部署的API。我已经从受信任的来源(Collibra)下载了此API,因此希望它能正常工作。

API请求:http://localhost:8081/connect/dgc/export/asset?filter=name%20STARTS_WITH%20E

这是其中一个xml文件中的基本身份验证设置。

<mule-ss:security-manager name ="authenticationManager" doc:name="Spring Security Provider">
    <mule-ss:delegate-security-provider
        name="memory-provider" delegate-ref="authenticationManager-common" />
</mule-ss:security-manager> 
<spring:beans>
    <ss:authentication-manager alias="authenticationManager-common">
        <ss:authentication-provider>
            <ss:user-service id="userService">
                <ss:user name="${service.user}" password="${service.password}"
                    authorities="ROLE_ADMIN" />
            </ss:user-service>
        </ss:authentication-provider>
    </ss:authentication-manager>
 </spring:beans>

这是属性文件中用户名/密码的设置。

service.user=user
service.password=password

[当我使用正确的凭据发出邮递员GET请求时,出现以下错误。

Failed to connect/reconnect: Work Descriptor. Root Exception was: Unexpected response with status code: 401 was returned. Message was: {"statusCode":401,"titleMessage":"Not authorized","userMessage":"The user name or password is wrong. Try again."}

这是如果我使用不正确的凭据会出现的错误。

Root Exception stack trace:
    org.springframework.security.authentication.BadCredentialsException: Bad credentials

当我通过基本身份验证传递正确的凭据时出现错误可能是怎么回事?我已经使用在线标题生成器仔细检查了字符串,这确实是正确的。

api get mule postman http-status-code-401
1个回答
0
投票

如果不了解API的实现,很难进行故障排除,但是鉴于凭据不正确的错误似乎来自Spring Security Manager,并且如果凭据正确,它似乎正在连接到其他对象,则可能是API正在调用一些后端系统或API并无法对其进行身份验证。

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