2016-06-16 22 views
0

我使用API​​M 1.10添加通過REST的API新的API將API(參見:https://docs.wso2.com/display/AM1100/apidocs/publisher/#!/operations#APIsApi#apisPost),它工作正常,但:WSO2 APIM 1.10 - 配置端點安全方案,同時通過REST的API

我想爲api端點添加security-scheme:「基本認證」。 但我不知道該怎麼做,因爲endpointConfig-config沒有描述。

我需要的是這樣的:endpointSecured:真,endpointAuthDigest: 「基本」,endpointUTUsername: 「USN」,endpointUTPassword: 「通過」

任何想法?

Ç雅, 馬蒂

回答

0

以下步驟將幫助你實現的需求。

  • 編輯API並轉到實施選項卡。
  • 點擊「顯示更多選項」。
  • 爲端點安全方案選擇「安全」。
  • 提供憑證並保存。
+0

這是如果你使用發佈UI的方式,但我想通過REST-API瞭解方式 – APIMAN

0

當您使用rest API創建API時,可以通過添加以下部分來添加安全端點詳細信息。
& endpointType =固定& epUsername = 「管理員」 & epPassword = 「管理員」

下面是一個簡單的命令

curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag -d "action=addAPI&name=SampleAPI&context=/country&version=1.0.0&visibility=public&thumbUrl=&description=Check Country by Code&tags=country&endpointType=secured&epUsername="admin"& epPassword="admin"&tiersCollection=Gold,Bronze&http_checked=http&https_checked=https&resourceCount=0&resourceMethod-0=GET&resourceMethodAuthType-0=Application&resourceMethodThrottlingTier-0=Unlimited&uriTemplate-0=/*&default_version_checked=default_version&bizOwner=xx&bizOwnerM[email protected]&techOwner=xx&[email protected]" -d'endpoint_config={"production_endpoints":{"url":"http://services.groupkt.com/country/get/iso2code/IN","config":null},"endpoint_type":"http"}';