[英]AWS API Gateway get Api key
我正在嘗試從API Gateway的“ API密鑰”中的API密鑰獲取實際密鑰。
AmazonApiGateway client = AmazonApiGatewayClientBuilder.standard().withRegion("my region").build();
GetApiKeysRequest req = new GetApiKeysRequest();
GetApiKeysResult keys = client.getApiKeys(req);
ApiKey key = keys.getItems().get(0); // just get the first one..
System.out.println(key.getId());
System.out.println(key.getName());
System.out.println(key.getValue());
希望getValue()將提供實際的鍵,但它為null。
確保將includeValues設置為true
:
req.setIncludeValues(true);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.