Apache jClouds-我们可以将身份验证keystone v3与application_credential一起使用吗?

时间:2020-07-17 09:05:07

标签: java openstack jclouds

jClouds是否支持application_credential kestonetone V3?

我正在使用OpenStack,并且我想对 jClouds 2.2.1 https://specs.openstack.org/openstack/keystone-specs/specs/keystone/queens/application-credentials.html)使用应用程序凭据身份验证。

梯形失真校正模块具有称为let j = JSON.parse('{ "Key1" :[ { "a" : "A1" , "b" : "B1"},{"a" : "A2" , "b" : "B2"}]}'); console.log("JSON at the beginning:\n", j); j.Key1.forEach((element, index) =>{ if(element.a === "A1"){ //Here I have to edit the JSON obj j.Key1[index]["New_Key_Array"] = [ { Found: "yes", Correctness: "true" } ]; } }); console.log("JSON edited:\n ",j); let objString =JSON.stringify(j);的身份验证方法。这是对application_credential的POST请求的示例:

application_credential

使用Java,我有以下代码:

$ curl -i -H "Content-Type: application/json" -d \
'{
    "auth": {
        "identity": {
            "methods": [
                "application_credential"
            ],
            "application_credential": {
                "id": "50916383859f4d2f919c86315ffa17ba",
                "secret": "demo"
            }
        }
    }
}' \
"http://192.168.190.1:5000/v3/auth/tokens"

它引发异常:

Properties overrides = new Properties();

overrides.put(KeystoneProperties.KEYSTONE_VERSION, "3");
overrides.put(KeystoneProperties.CREDENTIAL_TYPE,
              CredentialTypes.API_ACCESS_KEY_CREDENTIALS);
    
String accessKey = "accessKey";
String accessSecret = "accessSecret";
     
KeystoneApi keystone = ContextBuilder.newBuilder("openstack-keystone-3")
        .endpoint("https://keystone.domain/v3")
        .credentials(accessKey, accessSecret)
        .overrides(overrides)
        .modules(ImmutableSet.of(new SLF4JLoggingModule(),
                                 new OkHttpCommandExecutorServiceModule()))
        .buildApi(KeystoneApi.class);
     
keystone.getProjectApi().list();

谢谢。

1 个答案:

答案 0 :(得分:0)

您仍然有[https://jclouds.apache.org/guides/openstack/] [1]

因为它不起作用,也许我错过了一些东西 [1]:https://jclouds.apache.org/guides/openstack/