AJNOURI / COA

Openstack Foundation Openstack Certified Administrator exam Preparation
MIT License
45 stars 37 forks source link

domain-specific Openstack installation (Liberty): Generate token for user "user" The request you have made requires authentication. (HTTP 401) #33

Closed AJNOURI closed 8 years ago

AJNOURI commented 8 years ago

On domain-specific Openstack installation (Liberty), following installation documentation: keystone verification.

Could not issue token for "demo" user using:

openstack --os-auth-url http://libcontroller:5000/v3  \
--os-project-domain-id default \
--os-user-domain-id default \
--os-project-name demo \
--os-username demo \
--os-auth-type password  \
token issue

Password: The request you have made requires authentication. (HTTP 401) (Request-ID: req-fb58f2a0-5702-431a-89bf-c4550244b4b3)

AJNOURI commented 8 years ago

In the previous section Create projects, users, and roles, I have missed the step of attributing "user" role to user "demo".

Solution: Restore the environment variables and the keystone-paste.ini original file (hope you backed it up)

export OS_TOKEN=fd160f91514d59f6c947
export OS_URL=http://libcontroller:35357/v3
export OS_IDENTITY_API_VERSION=3
cp /etc/keystone/keystone-paste.ini.back  /etc/keystone/keystone-paste.ini

Because it is domain-specific installation don't forget to specify the project & user scope arguments --project-domain default --user-domain default

openstack role add --project-domain default --user-domain default --project demo --user demo user

Now following the verification steps: 1,2 then step 4

# openstack --os-auth-url http://libcontroller:5000/v3 \
   --os-project-domain-id default \
   --os-user-domain-id default \
   --os-project-name demo \
   --os-username demo \
   --os-auth-type password \
   token issue

Password: +------------+----------------------------------+ | Field | Value | +------------+----------------------------------+ | expires | 2016-11-10T08:49:20.716213Z | | id | f08091771ce34431abb4cc8bb6f9a45a | | project_id | 1c39e5ca87e842f0a1ba6bc572b45985 | | user_id | 73381ac4501348afbaaa36d71815d8b4 | +------------+----------------------------------+