This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

API client for LoginTC two-factor authentication.

Project Description

Introduction

The LoginTC Python client is a complete LoginTC REST API client to manage LoginTC organizations, users, domains, tokens and to create login sessions.

Installation

The libraries can be installed using the standard Python module installation method, Distutils. Note that you will also need to have setuptools installed

git clone https://github.com/logintc/logintc-python.git
cd logintc-python
python setup.py install

Alternatively, you should also be able to retrieve it from the Python Package Index via easy_install logintc or pip install logintc

Example

The following example will create an authentication session and wait 60 seconds for the user to approve or deny.

import logintc
import datetime
import time

apiKey = 'LWbSCedV8sgFxdu0mPB42wuVWG7o3hf2AyaWKeHc0k6XgUHGZQj6K3yMOqPXY4Fq'
domainId = '892e643b2da3547a705ba8f05316187976e11ec4'

client = logintc.LoginTC(apiKey)
session = client.create_session(domainId, username='john.doe')

timeout = datetime.datetime.today() + datetime.timedelta(seconds=60)

while datetime.datetime.today() < timeout:
    time.sleep(1)
    session = client.get_session(domainId, session['id'])
    if session['state'] == 'approved':
        print 'Approved!'
        break
    elif session['state'] == 'denied':
        print 'Denied!'
        break
    elif session['state'] == 'pending':
        print 'Waiting...'

Documentation

See https://www.logintc.com/docs

If you have Sphinx installed, you can run make html from the root directory to generate the API documentation for the library locally.

Release History

Release History

This version
History Node

1.1.9

History Node

1.1.8

History Node

1.1.7

History Node

1.1.6

History Node

1.1.5

History Node

1.1.4

History Node

1.1.3

History Node

1.1.2

History Node

1.1.1

History Node

1.1.0

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
logintc-1.1.9.tar.gz (11.8 kB) Copy SHA256 Checksum SHA256 Source Jan 11, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting