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

Exception in thread "main" AuthenticationException{message=Unauthorized, status=401} #741

Closed
jianke221 opened this issue Jul 8, 2016 · 5 comments

Comments

@jianke221
Copy link

i,please help me,I'm new to openstack and face a question and i don't know how to solve it.

program as below

public class Openstack4J {
public static void main(String agrs[]){
String domainIdentifier = "821bc14bee664077897ab4f54f029106";
OSClientV3 os = OSFactory.builderV3()
.endpoint("http://192.168.252.1:5000/v3")
.credentials("admin", "secret", Identifier.byName("admin"))
.scopeToProject(Identifier.byId(domainIdentifier))
.authenticate();
List<? extends SwiftContainer> containers = os.objectStorage().containers().list();
for (SwiftContainer currentContainer : containers) {
System.out.println(currentContainer.getName());
}
}
}

and i use Identity Service (Keystone) V3 ,

@auhlig
Copy link
Member

auhlig commented Jul 8, 2016

.scopeToProject(Identifier.byId(domainIdentifier))

Simple typo: Scope to project by domain identifier?
You either want to use the projectId or scope to a domain.

@jianke221
Copy link
Author

if i use the projectid ,what should i do? thank you @auhlig

@auhlig
Copy link
Member

auhlig commented Jul 8, 2016

Take a look at the examples in the 'Authenticating' section https://github.com/ContainX/openstack4j/blob/master/README.md#using-identity-v3-authentication

@auhlig
Copy link
Member

auhlig commented Jul 13, 2016

@jianke221: Please close if this issue is no longer valid. Thank.

@auhlig auhlig closed this as completed Aug 2, 2016
@aniketpol
Copy link

What is domainIdentifier where can i find it?

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