openstack的使用者登入,需要獲得集中許可權。
token
只需要提供使用者名稱和密碼即可獲得,介面
http://public_url/tokens method:POST body:{"auth":{"passwordCredentials":{"username":"%s", "password":"%s"}}
所屬專案
需要將獲得到的使用者ID,和所有的租戶ID進行逐步的查詢,看是否該使用者存在於多個專案中。
[root@node-5 newstest-master]# keystone user-role-list --user-id 7bbe7115263f4d33a40c132c03df7091 --tenant-id f7153088a2b34050b4b27a50456a4f3b WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored). +----------------------------------+--------+----------------------------------+----------------------------------+ | id | name | user_id | tenant_id | +----------------------------------+--------+----------------------------------+----------------------------------+ | 2262da376eb549a6a8ffcde6920c1a67 | Member | 7bbe7115263f4d33a40c132c03df7091 | f7153088a2b34050b4b27a50456a4f3b | +----------------------------------+--------+----------------------------------+----------------------------------+ [root@node-5 newstest-master]# keystone user-role-list --user-id 7bbe7115263f4d33a40c132c03df7091 --tenant-id ba07f67cfb48445da95f0385b1c8ef1f WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored). +----------------------------------+--------+----------------------------------+----------------------------------+ | id | name | user_id | tenant_id | +----------------------------------+--------+----------------------------------+----------------------------------+ | 2262da376eb549a6a8ffcde6920c1a67 | Member | 7bbe7115263f4d33a40c132c03df7091 | ba07f67cfb48445da95f0385b1c8ef1f | | 975b2c24fa53461f97ef1186e55b6ecf | admin | 7bbe7115263f4d33a40c132c03df7091 | ba07f67cfb48445da95f0385b1c8ef1f | +----------------------------------+--------+----------------------------------+----------------------------------+
這裡表示相同的使用者,在不同的使用者中都有存在資料,登入時都需要查詢出來。