Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scopeToProject requests are incorrect (3.0.0-SNAPSHOT) [V3 identity API] #664

Closed
wyllys66 opened this issue May 12, 2016 · 2 comments
Closed

Comments

@wyllys66
Copy link

Using the latest 3.0.0-SNAPSHOT code, when "scopeToProject" is used, the JSON request is incorrectly formatted (nothing appears in the "Scope" block and keystone service rejects it:

The Code:

        Identifier domainIdentifier = Identifier.byId("default");
        Identifier project = Identifier.byName("myproject");
        OSClientV3 os = OSFactory.builderV3()
                    .withConfig(Config.newConfig().withSSLVerificationDisabled())
                    .endpoint("https://localhost:5000/v3")
                    .credentials("FOOBAR", "FOOBAR", domainIdentifier)
                    .scopeToProject(project)
                    .authenticate();

The JSON request sent to the server:

{
  "auth" : {
    "identity" : {
      "password" : {
        "user" : {
          "name" : "FOOBAR",
          "domain" : {
            "id" : "default"
          },
          "password" : "FOOBAR"
        }
      },
      "methods" : [ "password" ]
    },
    "scope" : {
      "project" : { }
    }
  }
}

Keystone says:

{"error": {"message": "Expecting to find id or name in project. The server could not comply with the
 request since it is either malformed or otherwise incorrect. The client is assumed to be in error.",
 "code": 400, "title": "Bad Request"}}
@olivierlemasle
Copy link
Contributor

Hi,

Try using:

Identifier domainIdentifier = Identifier.byId("default");
Identifier project = Identifier.byName("myproject");
OSClientV3 os = OSFactory.builderV3()
        .withConfig(Config.newConfig().withSSLVerificationDisabled())
        .endpoint("https://localhost:5000/v3")
        .credentials("FOOBAR", "FOOBAR", domainIdentifier)
        .scopeToProject(project, domain)
        .authenticate();

This uses the domain-dependant scopeToProject method, which works in my case.

@wyllys66
Copy link
Author

Yep, that fixes it. Thanks!

@gondor gondor closed this as completed May 14, 2016
ashleycutalo added a commit to ashleycutalo/front50 that referenced this issue Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants