Skip to main content

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 git@github.com:logintc/logintc-python
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.

Help

Email: support@cyphercor.com

https://www.logintc.com

Project details


Download files

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

Source Distribution

logintc-1.0.1.tar.gz (11.6 kB view details)

Uploaded Source

File details

Details for the file logintc-1.0.1.tar.gz.

File metadata

  • Download URL: logintc-1.0.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for logintc-1.0.1.tar.gz
Algorithm Hash digest
SHA256 49c8b9275fbbfda063549ccf4f3e0afb3ee1a98702a18285f2414cb978ab9f6f
MD5 5e72aa80632c0207df48a306f7ea4b31
BLAKE2b-256 fa71555bf32fcf6bcca790c5a2f48efc494a24041b42867b93fc2d1d307a0159

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page