Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

API client for LoginTC two-factor authentication.

Project description


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


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
cd logintc-python
python install

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


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.timedelta(seconds=60)

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



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

Project details

Download files

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

Files for logintc, version 1.1.9
Filename, size File type Python version Upload date Hashes
Filename, size logintc-1.1.9.tar.gz (11.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page