Deprecated
in API level 30
Class Overview
This class provides APIs to create, delete, and get Lightweight Directory Access Protocol (LDAP) account settings on the
device. Use the LDAPAccount
class to fill up the relevant LDAP account
details.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Constants
public
static
final
String
ACTION_LDAP_CREATE_ACCT_RESULT
Since: API level 6
Constant Value:
"com.samsung.android.knox.intent.action.LDAP_CREATE_ACCT_RESULT"
public
static
final
int
ERROR_LDAP_ALREADY_EXISTS
Since: API level 6
LDAP account already exists.
Constant Value:
-1
(0xffffffff)
public
static
final
int
ERROR_LDAP_CONNECT_ERROR
Since: API level 6
LDAP server connection error.
Constant Value:
-7
(0xfffffff9)
public
static
final
int
ERROR_LDAP_INVALID_CREDENTIALS
Since: API level 6
Invalid LDAP credentials.
Constant Value:
-3
(0xfffffffd)
public
static
final
int
ERROR_LDAP_NONE
Since: API level 6
LDAP operation successful.
Constant Value:
0
(0x00000000)
public
static
final
int
ERROR_LDAP_SERVER_BUSY
Since: API level 6
Constant Value:
-4
(0xfffffffc)
public
static
final
int
ERROR_LDAP_SERVER_DOWN
Since: API level 6
Constant Value:
-5
(0xfffffffb)
public
static
final
int
ERROR_LDAP_TIMEOUT
Since: API level 6
LDAP server connection timeout.
Constant Value:
-6
(0xfffffffa)
public
static
final
int
ERROR_LDAP_UNKNOWN
Since: API level 6
Constant Value:
-8
(0xfffffff8)
public
static
final
String
EXTRA_LDAP_ACCT_ID
Since: API level 6
Constant Value:
"com.samsung.android.knox.intent.extra.LDAP_ACCT_ID"
public
static
final
String
EXTRA_LDAP_RESULT
Since: API level 6
Constant Value:
"com.samsung.android.knox.intent.extra.LDAP_RESULT"
public
static
final
String
EXTRA_LDAP_USER_ID
Since: API level 12
Constant Value:
"com.samsung.android.knox.intent.extra.LDAP_USER_ID"
Public Methods
public
void
createLDAPAccount
(LDAPAccount ldap)
Deprecated
in API level 30
API to configure a LDAP account.
Parameters
ldap
| LDAP account to be created |
Usage
An administrator can use this API to configure an LDAP account on a device by filling the LDAPAccount object without user interaction.
|
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
LDAPAccountPolicy ldapPolicy = edm.getLDAPAccountPolicy();
LDAPAccount ldap = new LDAPAccount();
ldap.userName = "";
ldap.password = "";
ldap.port = 389;
ldap.host = "ldap.xx.yy";
ldap.isSSL = true;
ldap.isAnonymous = true;
ldap.baseDN = "ou=xx,dc=samsung,dc=edu"
try {
ldapPolicy.createLDAPAccount(ldap);
} catch (SecurityException e) {
Log.w(TAG, "SecurityException: " + e);
}
|
For Container:
// When you create container successfully, containerID will be returned via intent.
// Use this containerID in below API.
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
LDAPAccountPolicy ldapPolicy = kcm.getLDAPAccountPolicy();
LDAPAccount ldap = new LDAPAccount();
ldap.userName = "";
ldap.password = "";
ldap.port = 389;
ldap.host = "ldap.xx.yy";
ldap.isSSL = true;
ldap.isAnonymous = true;
ldap.baseDN = "ou=xx,dc=samsung,dc=edu"
try {
ldapPolicy.createLDAPAccount(ldap);
} catch (SecurityException e) {
Log.w(TAG, "SecurityException: " + e);
}
Note: ldap.host and ldap.baseDN are mandatory parameters.
ldap.id is not used while creating LDAP account |
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_LDAP" permission which has a protection level
of signature. |
public
boolean
deleteLDAPAccount
(long id)
Deprecated
in API level 30
API to delete LDAP account.
Parameters
id
| LDAP account Id to be deleted |
Returns
true
if successful, else false
Usage
An administrator can use this API to delete an LDAP account on a device without user interaction.
The administrator can use the unique Id obtained when the LDAP account was created.
|
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
LDAPAccountPolicy ldapPolicy = edm.getLDAPAccountPolicy();
long ldapId = 1;
try {
ldapPolicy.deleteLDAPAccount(ldapId);
} catch (SecurityException e) {
Log.w(TAG, "SecurityException: " + e);
}
|
For Container:
// When you create container successfully, containerID will be returned via intent.
// Use this containerID in below API.
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
LDAPAccountPolicy ldapPolicy = kcm.getLDAPAccountPolicy();
long ldapId = 1;
try {
ldapPolicy.deleteLDAPAccount(ldapId);
} catch (SecurityException e) {
Log.w(TAG, "SecurityException: " + e);
}
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_LDAP" permission which has a protection level
of signature. |
public
List<LDAPAccount>
getAllLDAPAccounts
()
Deprecated
in API level 30
API to get list of all LDAP accounts.
Returns
- List of all existing
LDAPAccount
on the device if successful, else null
Usage
An administrator can use this API to get all LDAP accounts on the device.
|
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
LDAPAccountPolicy ldapPolicy = edm.getLDAPAccountPolicy();
try {
List list = ldapPolicy.getAllLDAPAccounts();
} catch (SecurityException e) {
Log.w(TAG, "SecurityException: " + e);
}
|
For Container:
// When you create container successfully, containerID will be returned via intent.
// Use this containerID in below API.
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
LDAPAccountPolicy ldapPolicy = kcm.getLDAPAccountPolicy();
try {
List list = ldapPolicy.getAllLDAPAccounts();
} catch (SecurityException e) {
Log.w(TAG, "SecurityException: " + e);
}
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_LDAP" permission which has a protection level
of signature. |
public
LDAPAccount
getLDAPAccount
(long id)
Deprecated
in API level 30
Parameters
id
| Id of the LDAP account whose details are to be retrieved |
Usage
An administrator can use this API to get a particular LDAP account on the device.
|
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
LDAPAccountPolicy ldapPolicy = edm.getLDAPAccountPolicy();
long ldapId = 1;
try {
LDAPAccount ldap = ldapPolicy.getLDAPAccount(ldapId);
} catch (SecurityException e) {
Log.w(TAG, "SecurityException: " + e);
}
|
For Container:
// When you create container successfully, containerID will be returned via intent.
// Use this containerID in below API.
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
LDAPAccountPolicy ldapPolicy = kcm.getLDAPAccountPolicy();
long ldapId = 1;
try {
LDAPAccount ldap = ldapPolicy.getLDAPAccount(ldapId);
} catch (SecurityException e) {
Log.w(TAG, "SecurityException: " + e);
}
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_LDAP" permission which has a protection level
of signature. |