<div dir="ltr">Additionally I realized that even if I did get it to work in CLI, my dashboard/horizon still is not able to list the users or projects for the admin user in the default domain, with the adminRole on both adminproject and default domain.<br><div class="gmail_extra"><br></div><div class="gmail_extra">TQ<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-02 9:35 GMT+01:00 Taisto Qvist <span dir="ltr"><<a href="mailto:taisto.qvist@gmail.com" target="_blank">taisto.qvist@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>I've found parts of the problem, but here is my policy.json excerpt:<br><br> "cloud_admin": "role:admin and (token.is_admin_project:True or domain_id:<wbr>d8aaf957fa5d4ced85cf308d464e00<wbr>20)",<br> "admin_and_matching_domain_id"<wbr>: "rule:admin_required and domain_id:%(domain_id)s",<br> "identity:get_domain": "rule:cloud_admin or rule:admin_and_matching_<wbr>domain_id or token.project.domain.id:%(<a href="http://target.domain.id" target="_blank">targ<wbr>et.domain.id</a>)s",<br> "identity:list_projects": "rule:cloud_admin or rule:admin_and_matching_<wbr>domain_id",<br> "identity:list_user_projects": "rule:owner or rule:admin_and_matching_<wbr>domain_id",<br> "identity:list_users": "rule:cloud_admin or rule:admin_and_matching_<wbr>domain_id",<br> "identity:list_groups": "rule:cloud_admin or rule:admin_and_matching_<wbr>domain_id",<br> "identity:list_users_in_group"<wbr>: "rule:cloud_admin or rule:admin_and_matching_<wbr>target_group_domain_id",<br><br></div>The cause of problem was the keystonerc-file I was sourcing, but I cant help wondering wether this error should be possible to avoid, and it seems I am still not all the way home...This was my inital keystonerc_admin:<br><br>export OS_PROJECT_DOMAIN_NAME=Default<br>export OS_USER_DOMAIN_NAME=Default<br>export OS_PROJECT_NAME=admin<br>export OS_USERNAME=admin<br>export OS_PASSWORD=admin00<br>export OS_AUTH_URL=<a href="http://172.16.12.100:35357/v3" target="_blank">http://172.16.12.<wbr>100:35357/v3</a><br>export OS_IDENTITY_API_VERSION=3<br>export OS_IMAGE_API_VERSION=2<br><br></div>I realized from ngrepping on the keystone api at :35357, that openstack was asking for a project scoped token, (which I thought I needed since my belief was that a domain-local admin should only have admin-role on a project in the domain but that doesnt seem to be the case?), but reading the policy rule made me realise that the "admin_required and domain_id:" wanted a domain-scoped token.<br><div><div><div><br></div><div>So I ran <span style="font-family:monospace,monospace">"openstack user list --os-domain-name default</span>", trying to get a domain scoped token, with the admin role, since my default admin user in the default domain, has the admin role on both default domain, and the admin project in the default domain. (Which seems to be a requirement, even for a local-domain admin)<br><br></div><div>However, because of (I assume) the OS_PROJECT_NAME env, the token is created with a:<br><br>{"auth": {"scope": {"project": {"domain": {"name": "Default"}, "name": "admin"}}, "identity": {"password": {"user": {"domain": {"name": "Default"}, "password": "admin00", "name": "admin"}}, "methods": ["password"]}}}<br><br></div><div>Now, yes, defining <b>both</b> OS_PROJECT_NAME and using <span style="font-family:monospace,monospace">--os-domain-name default</span> is of course kinda stupid, but since I can only have EITHER project scoped OR domain scoped tokens, isnt it kind of a bug that the openstack CLI is trying to give me a project scoped token, using the DOMAIN NAME???<br></div><div><br></div><div>However, it still doesnt work 100% correctly I think. Undefining OS_PROJECT NAME, and running <br><br>"<span style="font-family:monospace,monospace">openstack user list --os-domain-name Default</span>"<br><br></div><div><b>Will still not work</b>. I have to do:<br><br>"<span style="font-family:monospace,monospace">openstack user list </span><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">--os-domain-name Default</span> --domain <i><b>default</b></i></span><i><b> </b></i>"<br></div><div><br></div><div>And the reason I dont like that, is that I have to know the domain <i><b>UUID</b></i>(default), which a normal project/domain-*local* admin cant find out, because of the rule for identity:get_domain which said:<br><br> "identity:get_domain": "rule:cloud_admin or rule:admin_and_matching_<wbr>domain_id or token.project.domain.id:%(<a href="http://target.domain.id" target="_blank">targ<wbr>et.domain.id</a>)s",<br><br></div><div>The only way I can do openstack domain show <domain>, is if I already now the uuid to begin with...<br><br></div><div>Running <br><br><span style="font-family:monospace,monospace">openstack user list --os-domain-name Default --domain Default<br>openstack domain show --os-domain-name Default Default</span><br><br></div><div>result in: "Could not find resource Default"<br><br></div><div>So. Maybe I can fix this by allowing domain-names in the rule for get_domain, but since I cant fathom that I would be the first to try to list users with a domain local admin-user, I cant believe that I need to change the recently downloaded policy file.<br><br></div><div>Surely the major users of Openstack have started using domains by now?<br><br></div><div>Best Regards<br></div><div>Taisto Qvist<br><br></div><div><span style="font-family:monospace,monospace"></span></div><div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-01 22:17 GMT+01:00 Taisto Qvist <span dir="ltr"><<a href="mailto:taisto.qvist@gmail.com" target="_blank">taisto.qvist@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hi folks, <br><br></div>I've run into a wall with making openstack domain auth working, and I dont know where to get help, so I am trying here. I've created a question on:<br><br><a href="https://ask.openstack.org/en/question/98429/project-specific-admin-unable-to-list-users-or-use-horizon/" target="_blank">https://ask.openstack.org/en/q<wbr>uestion/98429/project-specific<wbr>-admin-unable-to-list-users-<wbr>or-use-horizon/</a><br><br></div>..but no-one seems to be able to help.<br><br></div>Since I wrote that, I've gotten as far as creating a working cloud-wide admin(the policy trigger for cloud_admin matching against domain_id, didnt seem to work for the default domain...?), and that user is now working fine as super-mega-admin.<br><br></div>But my old admin user, that has admin rights only in the default domain, admin project, cant list users, or projects, in the default domain.<br><br></div>And sureley he should be able to, with the rules:<br><br> "admin_and_matching_domain_id"<wbr>: "rule:admin_required and domain_id:%(domain_id)s",<br> "identity:list_users": "rule:cloud_admin or rule:admin_and_matching_domain<wbr>_id", <br><br></div>I've tried to find comprehensive and up2date references on how to read the policy.json syntax, but no success so I am unsure on how to interpret the rule exactly though.<br></div>I tried changing to:<br><br> "admin_and_matching_domain_id"<wbr>: "rule:admin_required and domain_id:%(<i>target</i>.domain_id)s<wbr>",<br><br></div>after looking at the rule for:<br><br> "identity:get_project": "rule:cloud_admin or rule:admin_and_matching_target<wbr>_project_domain_id or project_id:%(<a href="http://target.project.id" target="_blank">target.project.id</a><wbr>)s",<br><br></div>But it didnt help. During the failure, I can see keystone logging:<br><br>2016-11-01 22:16:24.521 4824 INFO keystone.common.wsgi [req-46e3301f-f234-434b-a013-5<wbr>aa2297b6119 admin_User <wbr> admin_Prj <wbr> - default default] GET <a href="http://172.16.12.100:35357/v3/projects/admin_Prj" target="_blank">http://172.16.12.100:35357/v3/<wbr>projects/admin_Prj</a><br><br></div><div>(where admin_Prj/User is the UUID's regexped)<br></div><div><br></div>What is wrong? Where can I learn how to do this??? <br></div>
</blockquote></div><br></div></div>
</blockquote></div><br></div></div>