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

Issue connecting Object Storage #151

Open
Sukhbhullar opened this issue Jun 18, 2018 · 3 comments
Open

Issue connecting Object Storage #151

Sukhbhullar opened this issue Jun 18, 2018 · 3 comments

Comments

@Sukhbhullar
Copy link

Sukhbhullar commented Jun 18, 2018

Hi There,

Trying to implement object storage in my organization but getting UNKNOWN Error with HTTP status 400.

When I try to open Auth URL from browser I am getting below output

{"version": {"status": "stable", "updated": "2016-04-04T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.6", "links": [{"href": "https://myserver:myport/v3/", "rel": "self"}]}}
Not sure what that mean though :)

and from my test class below is the error from log. tried with both tenantName and tenantname but result is same.

[main] ERROR org.javaswift.joss.command.impl.core.AbstractCommand - JOSS / HTTP POST call https://myserver:myport/v3, HTTP status 400, Error UNKNOWN
[main] ERROR org.javaswift.joss.command.impl.core.AbstractCommand - * Accept=application/json
Exception in thread "main" Command exception, HTTP Status code: 400 => UNKNOWN
at org.javaswift.joss.command.impl.core.httpstatus.HttpStatusChecker.verifyCode(HttpStatusChecker.java:45)
at org.javaswift.joss.command.impl.core.AbstractCommand.call(AbstractCommand.java:50)
at org.javaswift.joss.client.impl.ClientImpl.createAccount(ClientImpl.java:110)
at org.javaswift.joss.client.impl.ClientImpl.createAccount(ClientImpl.java:25)
at org.javaswift.joss.client.core.AbstractClient.authenticate(AbstractClient.java:35)
at org.javaswift.joss.client.factory.AccountFactory.createAccount(AccountFactory.java:30)
at org.javaswift.joss.tutorial.MainClass.main(MainClass.java:42)

using Joss 10.2 jar

BTW below is snippet from my test class

Account account = new AccountFactory()
//.setAuthenticationMethod(AuthenticationMethod.KEYSTONE_V3)
.setTenantName("MyTenant")
.setTenantId("MyTenantID")
.setUsername("MyUser")
.setPassword("MyPassword")
// .setAuthUrl("https://myserver:8080")
// .setAuthUrl("http://myserver:myport/v1/AUTH_MyTenantID")
.setAuthUrl("https://myserver:myport/v3")
.setMock(false)
.createAccount();

Have tried with different combinations(as shown in commented lines above) but no luck.

Any help is greatly appreciated.

@tfelix
Copy link
Contributor

tfelix commented Jul 3, 2018

Actually it looks like this might be similar to our problem. You could check if your endpoint requires a special scope. It seems like scoping is not implemented in JOSS. If no scope is given during authorization our Keystone responded with an (empty?) token which lead to an error later on. So we need to scope the token request to a project. See https://docs.openstack.org/keystone/pike/api_curl_examples.html JOSS sends the default but in some cases a JSON Payload similar to the Project scope is required.

We mitigated the problem by implementing an external authentication provider which does the same as JOSS does for V3 but instead generates the project scope payload. We will very likely open a pull request in a few days for JOSS with our (sorted out) code to enable project scoping for Keystone V3 auth.

@Sukhbhullar
Copy link
Author

Thanks a lot Thomas for your response.
I will try that out and will let you know how I go with it.

@tfelix
Copy link
Contributor

tfelix commented Jul 4, 2018

If it turns out to be the case meanwhile I have opened a PR and ported our code to the internals of Joss. There are still some issues with code quality which I have to fix but maybe this can help you as well: #156

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

2 participants