| Modifier and Type | Class and Description |
|---|---|
protected static class |
Http.ClientBuilder<T extends Http>
Builder for an Http client object.
|
static class |
Http.HttpBuilder |
| Modifier and Type | Field and Description |
|---|---|
static int |
BACKOFF_FACTOR |
static int |
DEFAULT_TIMEOUT_SECS |
static okhttp3.MediaType |
FORM_ENCODED |
static int |
INITIAL_BACKOFF_MS |
static okhttp3.MediaType |
JSON_ENCODED |
static int |
MAX_BACKOFF_MS |
static SimpleDateFormat |
RFC_2822_DATE_FORMAT |
protected int |
sigVersion |
static String |
UserAgentString |
| Modifier | Constructor and Description |
|---|---|
|
Http(String inMethod,
String inHost,
String inUri)
Deprecated.
Use the HttpBuilder instead
|
protected |
Http(String inMethod,
String inHost,
String inUri,
int timeout)
Deprecated.
Use the HttpBuilder instead
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAdditionalDuoHeader(Map<String,String> inAdditionalDuoHeaders) |
void |
addHeader(String name,
String value) |
void |
addParam(String name,
Integer value) |
void |
addParam(String name,
org.json.JSONObject value) |
void |
addParam(String name,
List<Object> value) |
void |
addParam(String name,
String value) |
protected String |
canonRequest(String date,
int sigVersion) |
okhttp3.Response |
executeHttpRequest()
Creates and executes a HTTP request.
|
Object |
executeJSONRequest()
Executes JSON request.
|
Object |
executeRequest() |
String |
executeRequestRaw() |
int |
nextRandomInt(int bound) |
void |
setProxy(String host,
int port)
Creates a new proxy.
|
protected String |
signHMAC(String skey,
String msg) |
void |
signRequest(String ikey,
String skey) |
void |
signRequest(String ikey,
String skey,
int inSigVersion)
Signs Duo request.
|
protected void |
sleep(long ms) |
void |
useCustomCertificates(String[] customCaCerts)
Use custom CA certificates for certificate pinning.
|
public static final int BACKOFF_FACTOR
public static final int INITIAL_BACKOFF_MS
public static final int MAX_BACKOFF_MS
public static final int DEFAULT_TIMEOUT_SECS
public static final String UserAgentString
protected int sigVersion
public static SimpleDateFormat RFC_2822_DATE_FORMAT
public static okhttp3.MediaType FORM_ENCODED
public static okhttp3.MediaType JSON_ENCODED
public Http(String inMethod, String inHost, String inUri)
inMethod - The method for the http requestinHost - The api host provided by Duo and found in the Duo admin panelinUri - The endpoint for the requestprotected Http(String inMethod, String inHost, String inUri, int timeout)
inMethod - The method for the http requestinHost - The api host provided by Duo and found in the Duo admin panelinUri - The endpoint for the requesttimeout - The timeout for the http requestpublic Object executeJSONRequest() throws Exception
Exception - If the result was not OKpublic okhttp3.Response executeHttpRequest()
throws Exception
UnsupportedEncodingException - For http methods that are not supportedExceptionpublic void signRequest(String ikey, String skey) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic void signRequest(String ikey, String skey, int inSigVersion) throws UnsupportedEncodingException
ikey - Integration key provided by Duo and found in the admin
panelskey - Secret key provided by Duo and found in the admin panelinSigVersion - The version of signature usedUnsupportedEncodingException - For unsupported encodingspublic void addParam(String name, org.json.JSONObject value)
public void addAdditionalDuoHeader(Map<String,String> inAdditionalDuoHeaders)
public void setProxy(String host, int port)
host - The proxy hostport - The port of the proxypublic void useCustomCertificates(String[] customCaCerts)
customCaCerts - The CA certificates to pinprotected String canonRequest(String date, int sigVersion) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic int nextRandomInt(int bound)
Copyright © 2025. All rights reserved.