Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to use an auth token for login #35

Merged
merged 1 commit into from Nov 12, 2017
Merged

Conversation

bigjools
Copy link
Contributor

@bigjools bigjools commented Sep 7, 2017

If using the https backend, you can call ProxmoxAPI.get_tokens() to
receive a tuple of the auth token and csrf prevention token. These
tokens can then be passed to the ProxmoxAPI() constructor to make
a new API object based on the tokens rather than a user name.

api = ProxmoxAPI('host', user='foo', password='password')
auth_token, csrf_token = api.get_tokens()
api2 = ProxmoxAPI(
'host', user='', password='', auth_token=auth_token,
csrf_token=csrf_token)

If using the https backend, you can call ProxmoxAPI.get_tokens() to
receive a tuple of the auth token and csrf prevention token. These
tokens can then be passed to the ProxmoxAPI() constructor to make
a new API object based on the tokens rather than a user name.

>>> api = ProxmoxAPI('host', user='foo', password='password')
>>> auth_token, csrf_token = api.get_tokens()
>>> api2 = ProxmoxAPI(
        'host', user='', password='', auth_token=auth_token,
        csrf_token=csrf_token)
@coveralls
Copy link

coveralls commented Sep 7, 2017

Coverage Status

Coverage decreased (-1.7%) to 81.081% when pulling 466a9e8 on bigjools:develop into e489195 on swayf:master.

@swayf swayf merged commit 466a9e8 into swayf:master Nov 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants