keystoneclient.v3.contrib.oauth1 package

keystoneclient.v3.contrib.oauth1 package


keystoneclient.v3.contrib.oauth1.access_tokens module

class keystoneclient.v3.contrib.oauth1.access_tokens.AccessToken(manager, info, loaded=False)

Bases: keystoneclient.base.Resource

class keystoneclient.v3.contrib.oauth1.access_tokens.AccessTokenManager(client)

Bases: keystoneclient.base.CrudManager

Manager class for manipulating identity OAuth access tokens.

create(consumer_key, consumer_secret, request_key, request_secret, verifier)

alias of AccessToken

keystoneclient.v3.contrib.oauth1.auth module

class keystoneclient.v3.contrib.oauth1.auth.OAuth(auth_url, *args, **kwargs)

Bases: keystoneclient.auth.identity.v3.base.AuthConstructor

class keystoneclient.v3.contrib.oauth1.auth.OAuthMethod(**kwargs)

Bases: keystoneclient.auth.identity.v3.base.AuthMethod

OAuth based authentication method.

  • consumer_key (string) – Consumer key.

  • consumer_secret (string) – Consumer secret.

  • access_key (string) – Access token key.

  • access_secret (string) – Access token secret.

get_auth_data(session, auth, headers, **kwargs)

Return the authentication section of an auth plugin.

  • session (keystoneclient.session.Session) – The communication session.

  • auth (base.Auth) – The auth plugin calling the method.

  • headers (dict) – The headers that will be sent with the auth request if a plugin needs to add to them.


The identifier of this plugin and a dict of authentication data for the auth type.

Return type

tuple(string, dict)

keystoneclient.v3.contrib.oauth1.consumers module

class keystoneclient.v3.contrib.oauth1.consumers.Consumer(manager, info, loaded=False)

Bases: keystoneclient.base.Resource

Represents an OAuth consumer.

  • id: a uuid that identifies the consumer

  • description: a short description of the consumer

class keystoneclient.v3.contrib.oauth1.consumers.ConsumerManager(client)

Bases: keystoneclient.base.CrudManager

Manager class for manipulating identity consumers.

base_url = '/OS-OAUTH1'
collection_key = 'consumers'
create(description=None, **kwargs)
key = 'consumer'

alias of Consumer

update(consumer, description=None, **kwargs)

keystoneclient.v3.contrib.oauth1.core module

class keystoneclient.v3.contrib.oauth1.core.OAuthManager(api)

Bases: object

class keystoneclient.v3.contrib.oauth1.core.OAuthManagerOptionalImportProxy

Bases: object

Act as a proxy manager in case oauthlib is no installed.

This class will only be created if oauthlib is not in the system, trying to access any of the attributes in name (access_tokens, consumers, request_tokens), will result in a NotImplementedError, and a message.

>>> manager.access_tokens.blah
NotImplementedError: To use 'access_tokens' oauthlib must be installed

Otherwise, if trying to access an attribute other than the ones in name, the manager will state that the attribute does not exist.

>>> manager.dne.blah
AttributeError: 'OAuthManagerOptionalImportProxy' object has no
attribute 'dne'

keystoneclient.v3.contrib.oauth1.request_tokens module

class keystoneclient.v3.contrib.oauth1.request_tokens.RequestToken(manager, info, loaded=False)

Bases: keystoneclient.base.Resource

class keystoneclient.v3.contrib.oauth1.request_tokens.RequestTokenManager(client)

Bases: keystoneclient.base.CrudManager

Manager class for manipulating identity OAuth request tokens.

authorize(request_token, roles)

Authorize a request token with specific roles.

Utilize Identity API operation: PUT /OS-OAUTH1/authorize/$request_token_id

  • request_token – a request token that will be authorized, and can be exchanged for an access token.

  • roles – a list of roles, that will be delegated to the user.

create(consumer_key, consumer_secret, project)

alias of RequestToken

keystoneclient.v3.contrib.oauth1.utils module


Parse the URL response body to retrieve the oauth token key and secret.

The response body will look like: ‘oauth_token=12345&oauth_token_secret=67890’ with ‘oauth_expires_at=2013-03-30T05:27:19.463201’ possibly there, too.

Module contents

Creative Commons Attribution 3.0 License

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