← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1878438] Re: error when using token get from application credential authentication

 

You do not need to create a new token or a new session. The application
credential session should be used for your keystone client session.

** Changed in: keystone
       Status: In Progress => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1878438

Title:
  error when using token get from application credential authentication

Status in OpenStack Identity (keystone):
  Invalid

Bug description:
  Currently, from queens version was supported Application Credentials.
  But, when I using a token was created from application credentials authentication to create a session after using this session to create a python client, I was get an error log like:

  2020-05-13 18:16:50.418018 2020-05-13 18:16:50.416 34 ERROR keystone.common.wsgi [req-21d4d259-58d1-4e22-997d-ad223bce46a1 393bd2ca957b464e9239ed6216ba964b 29ac25437aa04afa97e53f12a6d7567a - default defau
  lt] 'application_credential': KeyError: 'application_credential'
  2020-05-13 18:16:50.418053 2020-05-13 18:16:50.416 34 ERROR keystone.common.wsgi Traceback (most recent call last):
  2020-05-13 18:16:50.418060 2020-05-13 18:16:50.416 34 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/dist-packages/keystone/common/wsgi.py", line 226, in __call__
  2020-05-13 18:16:50.418065 2020-05-13 18:16:50.416 34 ERROR keystone.common.wsgi     result = method(req, **params)
  2020-05-13 18:16:50.418069 2020-05-13 18:16:50.416 34 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/dist-packages/keystone/auth/controllers.py", line 135, in authenticate_for_token
  2020-05-13 18:16:50.418074 2020-05-13 18:16:50.416 34 ERROR keystone.common.wsgi     app_cred_id = token_auth['application_credential']['id']
  2020-05-13 18:16:50.418078 2020-05-13 18:16:50.416 34 ERROR keystone.common.wsgi KeyError: 'application_credential'

  Steps perform:
  1. Create a application credentials with command:
  openstack application credential create openstack-ac --secret openstack

  2. I using ipython to create session, python client:
  from keystoneauth1.identity import v3
  from keystoneauth1.session import Session

  auth = v3.ApplicationCredential(
  auth_url="http://127.0.0.1:5000/v3";,
  application_credential_id="ca5936c4382c4e8abf4be7ed7b0837c5",
  application_credential_secret="openstack")

  session = Session(auth=auth)

  3. I using above session to get a new token and make a new auth:
  auth = v3.Token(
  auth_url="http://127.0.0.1:5000/v3";,
  token=session.get_token(),
  project_name="admin",
  project_domain_name="Default")

  #make a new session
  session = Session(auth=auth)

  4. Make a keystone client using above session:
  keystone = keystone_client.Client(session=session)

  # Use keystone client to list projects
  keystone.projects.list()

  Is this a bug?

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1878438/+subscriptions


References