401 错误,Mule 而 Username/Password 是正确的
401 Error, Mule while Username/Password are Correct
我正在尝试使用 postman 来调用我用 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>
这里是属性文件中 username/password 的设置。
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
当我通过 Basic Auth 传递正确的凭据时出现错误可能是哪里出了问题?我有 double-checked 带有在线 header 生成器的字符串,它确实是正确的。
如果不了解 API 实现就很难进行故障排除,但鉴于凭据不正确的错误似乎来自 Spring 安全管理器,并且凭据正确,它看起来正在连接到其他原因,API 可能正在调用某些后端系统或 API 并且无法对其进行身份验证。
我正在尝试使用 postman 来调用我用 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>
这里是属性文件中 username/password 的设置。
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
当我通过 Basic Auth 传递正确的凭据时出现错误可能是哪里出了问题?我有 double-checked 带有在线 header 生成器的字符串,它确实是正确的。
如果不了解 API 实现就很难进行故障排除,但鉴于凭据不正确的错误似乎来自 Spring 安全管理器,并且凭据正确,它看起来正在连接到其他原因,API 可能正在调用某些后端系统或 API 并且无法对其进行身份验证。