Bypass Codes

Bypass codes are 9 digit numeric codes that allow your users to authenticate in the event they can’t access their 2nd factor device. They are associated with a user and can be used to access any domain in your organization.

Resources

POST /api/users/{userId}/bypasscodes

Create a bypass code for a user.

A user can have a maximum of 5 bypass codes.

Parameters

Name Description Required
usesAllowed The number of uses allows for the bypasscode. Must be between 1-1000. Yes
expirationTime Expiration time of bypass codes in minutes. Must be between 1-525600 (number of minutes in a year). Yes

Example

$ curl -X POST https://cloud.logintc.com/api/users/8c184f495a5b7b6e9ed732f2ce3c67e310806f38/bypasscodes \
  -d '{"usesAllowed" : "5", "expirationTime" : "43200"}' \
  -H 'Authorization: LoginTC key="YOUR_API_KEY"'
{
    "id":"8eb5d62d725b55a611b966fd5fc0fb6b5e93e476",
    "code":"478321641",
    "usesAllowed":5,
    "usesRemaining":5,
    "dtExpiry":"2015-08-14T11:10:00-0400",
    "user":"8c184f495a5b7b6e9ed732f2ce3c67e310806f38"
}
<?php
// Get the library from github.com/logintc/logintc-php
require_once('logintc-php/LoginTC.php');

// Your API Key from cloud.logintc.com/panel/settings
$api_key = 'YOUR_API_KEY';
$logintc = new LoginTC($api_key);

// Bypass Code details
$user_id = '8c184f495a5b7b6e9ed732f2ce3c67e310806f38';
$uses_allowed = 5;
$expiration_time = 43200;

// Helper function to create bypass code
$bypass_code = $logintc->createBypassCode($user_id, $uses_allowed, $expiration_time);

echo $bypass_code->getId();
# Get the library from github.com/logintc/logintc-python
import logintc

# Your API Key from cloud.logintc.com/panel/settings
api_key = 'YOUR_API_KEY'
client = logintc.LoginTC(api_key)

# User details
user_id = '8c184f495a5b7b6e9ed732f2ce3c67e310806f38'
uses_allowed = 5
expiration_time = 43200

# Helper function to create bypass code
bypass_code = client.create_bypass_code(user_id, uses_allowed, expiration_time)

print bypass_code['id']
// Get the library from github.com/logintc/logintc-java
import com.cyphercor.logintc.LoginTC;
import com.cyphercor.logintc.LoginTC.LoginTCException;
import com.cyphercor.logintc.resource.BypassCode;
 
public class Example { 
 
  // Your API Key from cloud.logintc.com/panel/settings
  public static final String API_KEY = "YOUR_API_KEY";
 
  public static void main(String[] args) throws LoginTCException {
    LoginTC logintc = new LoginTC(API_KEY);
 
    // Bypass Code details
    String user_id = "8c184f495a5b7b6e9ed732f2ce3c67e310806f38";
    Integer uses_allowed = 5;
    Integer expiration_time = 43200;

    // Helper function to create bypass code
    BypassCode bypass_code = logintc.createBypassCode(user_id, uses_allowed, expiration_time);

    System.out.println(bypass_code.getId());
  }
}

GET /api/users/{userId}/bypasscodes

Get all of a user’s bypass codes.

Example

$ curl -X GET https://cloud.logintc.com/api/users/8c184f495a5b7b6e9ed732f2ce3c67e310806f38/bypasscodes \
  -H 'Authorization: LoginTC key="YOUR_API_KEY"'
[
    {
    "id":"8eb5d62d725b55a611b966fd5fc0fb6b5e93e476",
    "code":"478321641",
    "usesAllowed":5,
    "usesRemaining":5,
    "dtExpiry":"2015-08-14T11:10:00-0400",
    "user":"8c184f495a5b7b6e9ed732f2ce3c67e310806f38"
    }
]
<?php
// Get the library from github.com/logintc/logintc-php
require_once('logintc-php/LoginTC.php');

// Your API Key from cloud.logintc.com/panel/settings
$api_key = 'YOUR_API_KEY';
$logintc = new LoginTC($api_key);

// User details
$user_id = '8c184f495a5b7b6e9ed732f2ce3c67e310806f38';

// Helper function to get all of a user's bypass codes
$bypass_codes = $logintc->getBypassCodes($user_id);

foreach( $bypass_codes as $bypass_code ) {
  echo $bypass_code->getId();
}
# Get the library from github.com/logintc/logintc-python
import logintc

# Your API Key from cloud.logintc.com/panel/settings
api_key = 'YOUR_API_KEY'
client = logintc.LoginTC(api_key)

# User details
user_id = '8c184f495a5b7b6e9ed732f2ce3c67e310806f38'

# Helper function to get all of a user's bypass codes
bypass_codes = client.get_bypass_codes(user_id)

for bypass_code in bypass_codes:
  print bypass_code['id']
// Get the library from github.com/logintc/logintc-java
import com.cyphercor.logintc.LoginTC;
import com.cyphercor.logintc.LoginTC.LoginTCException;
import com.cyphercor.logintc.resource.BypassCode;
 
public class Example { 
 
  // Your API Key from cloud.logintc.com/panel/settings
  public static final String API_KEY = "YOUR_API_KEY";
 
  public static void main(String[] args) throws LoginTCException {
    LoginTC logintc = new LoginTC(API_KEY);

    // User details
    String user_id = "8c184f495a5b7b6e9ed732f2ce3c67e310806f38";

    // Helper function to get all of a user's bypass codes
    List<BypassCode> bypass_codes = logintc.getBypassCodes(user_id);

    for (BypassCode bypass_code : bypass_codes) {
        System.out.println(bypass_code.getId());
    }
  }
}

GET /api/bypasscodes/{bypassCodeId}

Get a specific bypass code.

Example

$ curl -X GET https://cloud.logintc.com/api/bypasscodes/8eb5d62d725b55a611b966fd5fc0fb6b5e93e476 \
  -H 'Authorization: LoginTC key="YOUR_API_KEY"'
{
    "id":"8eb5d62d725b55a611b966fd5fc0fb6b5e93e476",
    "code":"478321641",
    "usesAllowed":5,
    "usesRemaining":5,
    "dtExpiry":"2015-08-14T11:10:00-0400",
    "user":"8c184f495a5b7b6e9ed732f2ce3c67e310806f38"
}
<?php
// Get the library from github.com/logintc/logintc-php
require_once('logintc-php/LoginTC.php');

// Your API Key from cloud.logintc.com/panel/settings
$api_key = 'YOUR_API_KEY';
$logintc = new LoginTC($api_key);

// Bypass Code details
$bypass_code_id = '8eb5d62d725b55a611b966fd5fc0fb6b5e93e476';

// Helper function to get a bypass code
$bypass_code = $logintc->getBypassCode($bypass_code_id);

echo $bypass_code->getId();
# Get the library from github.com/logintc/logintc-python
import logintc

# Your API Key from cloud.logintc.com/panel/settings
api_key = 'YOUR_API_KEY'
client = logintc.LoginTC(api_key)

# Bypass Code details
bypass_code_id = '8eb5d62d725b55a611b966fd5fc0fb6b5e93e476'

# Helper function to get a bypass code
bypass_code = client.get_bypass_code(bypass_code_id)

print bypass_code['id']
// Get the library from github.com/logintc/logintc-java
import com.cyphercor.logintc.LoginTC;
import com.cyphercor.logintc.LoginTC.LoginTCException;
import com.cyphercor.logintc.resource.BypassCode;
 
public class Example { 
 
  // Your API Key from cloud.logintc.com/panel/settings
  public static final String API_KEY = "YOUR_API_KEY";
 
  public static void main(String[] args) throws LoginTCException {
    LoginTC logintc = new LoginTC(API_KEY);

    // Bypass Code details
    String bypass_code_id = "8eb5d62d725b55a611b966fd5fc0fb6b5e93e476";

    // Helper function to get a bypass code
    BypassCode bypass_code = logintc.getBypassCode(bypass_code_id);

    System.out.println(bypass_code.getId());
  }
}

DELETE /api/users/{userId}/bypasscodes

Delete all of a user’s bypass codes.

Example

$ curl -X DELETE https://cloud.logintc.com/api/users/8c184f495a5b7b6e9ed732f2ce3c67e310806f38/bypasscodes \
  -H 'Authorization: LoginTC key="YOUR_API_KEY"'
<?php
// Get the library from github.com/logintc/logintc-php
require_once('logintc-php/LoginTC.php');

// Your API Key from cloud.logintc.com/panel/settings
$api_key = 'YOUR_API_KEY';
$logintc = new LoginTC($api_key);

// User details
$user_id = '8c184f495a5b7b6e9ed732f2ce3c67e310806f38';

// Helper function to delete all of a user's bypass codes
$logintc->deleteBypassCodes($user_id);
# Get the library from github.com/logintc/logintc-python
import logintc

# Your API Key from cloud.logintc.com/panel/settings
api_key = 'YOUR_API_KEY'
client = logintc.LoginTC(api_key)

# User details
user_id = '8c184f495a5b7b6e9ed732f2ce3c67e310806f38'

# Helper function to delete all of a user's bypass codes
client.delete_bypass_codes(user_id)
// Get the library from github.com/logintc/logintc-java
import com.cyphercor.logintc.LoginTC;
import com.cyphercor.logintc.LoginTC.LoginTCException;
 
public class Example { 
 
  // Your API Key from cloud.logintc.com/panel/settings
  public static final String API_KEY = "YOUR_API_KEY";
 
  public static void main(String[] args) throws LoginTCException {
    LoginTC logintc = new LoginTC(API_KEY);

    // User details
    String user_id = "8c184f495a5b7b6e9ed732f2ce3c67e310806f38";

    // Helper function to delete all of a user's bypass codes
    logintc.deleteBypassCodes(user_id);
  }
}

DELETE /api/bypasscodes/{bypassCodeId}

Delete a bypass code.

Example

$ curl -X DELETE https://cloud.logintc.com/api/bypasscodes/8eb5d62d725b55a611b966fd5fc0fb6b5e93e476 \
  -H 'Authorization: LoginTC key="YOUR_API_KEY"'
<?php
// Get the library from github.com/logintc/logintc-php
require_once('logintc-php/LoginTC.php');

// Your API Key from cloud.logintc.com/panel/settings
$api_key = 'YOUR_API_KEY';
$logintc = new LoginTC($api_key);

// Bypass Code details
$bypass_code_id = '8eb5d62d725b55a611b966fd5fc0fb6b5e93e476';

// Helper function to delete a bypass code
$logintc->deleteBypassCode($bypass_code_id);
# Get the library from github.com/logintc/logintc-python
import logintc

# Your API Key from cloud.logintc.com/panel/settings
api_key = 'YOUR_API_KEY'
client = logintc.LoginTC(api_key)

# Bypass Code details
bypass_code_id = '8eb5d62d725b55a611b966fd5fc0fb6b5e93e476'

# Helper function to delete a bypass code
client.delete_bypass_code(bypass_code_id)
// Get the library from github.com/logintc/logintc-java
import com.cyphercor.logintc.LoginTC;
import com.cyphercor.logintc.LoginTC.LoginTCException;
 
public class Example { 
 
  // Your API Key from cloud.logintc.com/panel/settings
  public static final String API_KEY = "YOUR_API_KEY";
 
  public static void main(String[] args) throws LoginTCException {
    LoginTC logintc = new LoginTC(API_KEY);

    // Bypass Code details
    String bypass_code_id = "8eb5d62d725b55a611b966fd5fc0fb6b5e93e476";

    // Helper function to delete a bypass code
    logintc.deleteBypassCode(bypass_code_id);
  }
}