[英]Expose API with Basic Authentication in WSO2 API Manager 4.1.0 - Dynamic Authentication
There is a WSO2 EI backend running with Basic Auth
mechanism.有一个运行
Basic Auth
机制的 WSO2 EI 后端。
Postman - WSO2 EI URL Hit: Postman - WSO2 EI URL 点击:
OAuth
OAuth
401 unauthorized ERROR
as per below postman hit.401 unauthorized ERROR
。 Postman - APIM URL Hit: Postman - APIM URL 命中:
WSO2 APIM Publisher: WSO2 APIM 发布者:
WSO2 APIM Dev Portal: WSO2 APIM 开发门户:
TryitTool in DEV Portal: DEV 门户中的 TryitTool:
Scenario:设想:
Endpoint Security Configurations
of Publisher portal.Endpoint Security Configurations
中设置 static 值。 Note: Basic Auth credentials ( admin:admin
) is passed in each api hit注意:基本身份验证凭据 (
admin:admin
) 在每次 api 命中时传递
Am I missing anything?我错过了什么吗? How can we achieve this?
我们怎样才能做到这一点?
The API Gateway drops the authentication header and that's why you get 401. You can set the EI credentials at the endpoint credentials so that authentication header is passed to the backend. API 网关丢弃身份验证 header,这就是您获得 401 的原因。您可以在端点凭据处设置 EI 凭据,以便将身份验证 header 传递到后端。 Go to the endpoint section at the APIM and provide the same credentials as the endpoint credentials.
Go 到 APIM 的端点部分,并提供与端点凭据相同的凭据。
Although your EI endpoint is secured with basic authentication, you don't need to expose the API at the gateway with basic authentication.尽管您的 EI 端点使用基本身份验证进行保护,但您无需使用基本身份验证在网关处公开 API。 You can use OAuth or API keys.
您可以使用 OAuth 或 API 密钥。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.