# keystoneauth1.identity.access module

class keystoneauth1.identity.access.AccessInfoPlugin(auth_ref: AccessInfo, auth_url: str | None = None)

  Bases: `BaseIdentityPlugin`

  A plugin that turns an existing AccessInfo object into a usable plugin.

  There are cases where reuse of an auth_ref or AccessInfo object is warranted such as from a cache, from auth_token middleware, or another source.

  Turn the existing access info object into an identity plugin. This plugin cannot be refreshed as the AccessInfo object does not contain any authorizing information.

  Parameters:

    - auth_ref (keystoneauth1.access.AccessInfo) – the existing AccessInfo object.

    - auth_url – the url where this AccessInfo was retrieved from. Required if using the AUTH_INTERFACE with get_endpoint. (optional)

  __abstractmethods__ = frozenset({})
  __annotate_func__()

    The type of the None singleton.

  __annotations_cache__ = {'auth_ref': <class 'keystoneauth1.access.access.AccessInfo'>}
  __doc__ = 'A plugin that turns an existing AccessInfo object into a usable plugin.\n\nThere are cases where reuse of an auth_ref or AccessInfo object is\nwarranted such as from a cache, from auth_token middleware, or another\nsource.\n\nTurn the existing access info object into an identity plugin. This plugin\ncannot be refreshed as the AccessInfo object does not contain any\nauthorizing information.\n\n:param auth_ref: the existing AccessInfo object.\n:type auth_ref: keystoneauth1.access.AccessInfo\n:param auth_url: the url where this AccessInfo was retrieved from. Required\n if using the AUTH_INTERFACE with get_endpoint. (optional)\n'
  __firstlineno__ = 19
  __init__(auth_ref: AccessInfo, auth_url: str | None = None)
  __module__ = 'keystoneauth1.identity.access'
  __static_attributes__ = ('auth_ref',)
  _abc_impl = <_abc._abc_data object>
  auth_ref: AccessInfo
  get_auth_ref(session: Session) → AccessInfo

    Obtain a token from an OpenStack Identity Service.

    This method is overridden by the various token version plugins.

    This function should not be called independently and is expected to be invoked via the do_authenticate function.

    This function will be invoked if the AcessInfo object cached by the plugin is not valid. Thus plugins should always fetch a new AccessInfo when invoked. If you are looking to just retrieve the current auth data then you should use get_access.

    Parameters:

      session (keystoneauth1.session.Session) – A session object that can be used for communication.

    Raises:

      - keystoneauth1.exceptions.response.InvalidResponse – The response returned wasn’t appropriate.

      - keystoneauth1.exceptions.http.HttpError – An error from an invalid HTTP response.

    Returns:

      Token access information.

    Return type:

      `keystoneauth1.access.AccessInfo`

  invalidate() → bool

    Invalidate the current authentication data.

    This should result in fetching a new token on next call.

    A plugin may be invalidated if an Unauthorized HTTP response is returned to indicate that the token may have been revoked or is otherwise now invalid.

    Returns:

      True if there was something that the plugin did to invalidate. This means that it makes sense to try again. If nothing happens returns False to indicate give up.

    Return type:

      bool

this page last updated: 2026-07-14 15:48:40

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug