Since: API level 20
public class

AuthConfig

extends Object
implements Parcelable
java.lang.Object
   ↳ com.samsung.android.knox.net.AuthConfig

Class Overview

This class is used to encapsulate proxy authentication information to be used while configuring a Global Proxy or a Wifi Profile with proxy. Proxy configurations that use this helper class support proxies with Basic and NTLMv1 authentication. The applied policy will choose the most secure authentication type in case the configured proxy supports multiple authentications simultaneously.

Since
API level 20
MDM 5.7

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static String ANY_HOST Constant to specify that all proxy hostnames and ip addresses should use the same credentials supplied in AuthConfig(String, int, String, String).
public static int ANY_PORT Constant to specify that all proxy ports should use the same credentials supplied in AuthConfig(String, int, String, String).
Public Constructors
AuthConfig(String username, String password)
Constructor used to specify the username and password that shall be used when connecting to any authenticated proxy.
AuthConfig(String host, int port, String username, String password)
Constructor used to specify the username and password that shall be used when connecting to a specific authenticated proxy.
Public Methods
String getHost()
Used to return the configured proxy hostname or ip address that will be used to fetch authentication information (username/password).
String getPassword()
Used to return the configured password that will be used to authenticate in the associated proxy.
int getPort()
Used to return the configured proxy port that will be used to fetch authentication information (username/password).
String getUsername()
Used to return the configured username that will be used to authenticate in the associated proxy.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static String ANY_HOST

Since: API level 20

Constant to specify that all proxy hostnames and ip addresses should use the same credentials supplied in AuthConfig(String, int, String, String).

Since
API level 20
MDM 5.7

public static int ANY_PORT

Since: API level 20

Constant to specify that all proxy ports should use the same credentials supplied in AuthConfig(String, int, String, String).

Since
API level 20
MDM 5.7

Public Constructors

public AuthConfig (String username, String password)

Since: API level 20

Constructor used to specify the username and password that shall be used when connecting to any authenticated proxy. This is most likely to be used with a manual proxy configuration, when all the network traffic goes through only one proxy regardless the URL requested by the client.


NOTES:

- Since KNOX 3.4, a domain credential can precede the parameter username.
- It is optional and the default value is received from the server during authentication process.


Example:
syntax 1: username
syntax 2: domain\username

Parameters
username Username that shall be used in any authenticated proxy.
password Password that shall be used in any authenticated proxy.
Throws
IllegalArgumentException If one or more parameter is null or empty.
Since
API level 20
MDM 5.7

public AuthConfig (String host, int port, String username, String password)

Since: API level 20

Constructor used to specify the username and password that shall be used when connecting to a specific authenticated proxy. The configuration made with this constructor will have precedence over AuthConfig(String, String) if the provided host and port parameters matches the proxy being connected. This is most likely to be used with an automatic proxy configuration (PAC), when the network traffic can go through one or more proxies, depending on the URL requested.


NOTES:

- Since KNOX 3.4, a domain credential can precede the parameter username.
- It is optional and the default value is received from the server during authentication process.


Example:
syntax 1: username
syntax 2: domain\username

Parameters
host Hostname or ip address of the authenticated proxy; use ANY_HOST for all hosts.
port Port of the authenticated proxy; use ANY_PORT for all ports.
username Username that shall be used in the specified authenticated proxy.
password Password that shall be used in the specified authenticated proxy.
Throws
IllegalArgumentException If one or more parameter is null or empty.
Since
API level 20
MDM 5.7

Public Methods

public String getHost ()

Since: API level 20

Used to return the configured proxy hostname or ip address that will be used to fetch authentication information (username/password).

Returns
  • Hostname or ip address of the authenticated proxy or ANY_HOST if no specific proxy is configured to use correspondent username and password.
Since
API level 20
MDM 5.7

public String getPassword ()

Since: API level 20

Used to return the configured password that will be used to authenticate in the associated proxy.

Returns
  • Password to be used in an authenticated proxy.
Since
API level 20
MDM 5.7

public int getPort ()

Since: API level 20

Used to return the configured proxy port that will be used to fetch authentication information (username/password).

Returns
  • Port of the authenticated proxy or ANY_PORT if no specific proxy is configured to use correspondent username and password.
Since
API level 20
MDM 5.7

public String getUsername ()

Since: API level 20

Used to return the configured username that will be used to authenticate in the associated proxy.

Returns
  • Username to be used in an authenticated proxy.
Since
API level 20
MDM 5.7