Package org.linphone.core
Interface AuthInfo
public interface AuthInfo
Object holding authentication information.
In most case, authentication information consists of a username and password.
If realm isn't set, it will be deduced automatically from the first
authentication challenge as for the hash algorithm. Sometimes, a userid is
required by the proxy and then domain can be useful to discriminate different
credentials. You can also use this object if you need to use a client
certificate.
Once created and filled, a
in order to become known and used automatically when needed. Use
for that purpose.
The
information when needed to the application through the
authentication_requested() callback of it's
The application can respond to this information request later using
. This will unblock all pending authentication transactions and retry them with
authentication headers.
In most case, authentication information consists of a username and password.
If realm isn't set, it will be deduced automatically from the first
authentication challenge as for the hash algorithm. Sometimes, a userid is
required by the proxy and then domain can be useful to discriminate different
credentials. You can also use this object if you need to use a client
certificate.
Once created and filled, a
AuthInfo
must be added to the Core
in order to become known and used automatically when needed. Use
Core.addAuthInfo(org.linphone.core.AuthInfo)
for that purpose.
The
Core
object can take the initiative to request authenticationinformation when needed to the application through the
authentication_requested() callback of it's
CoreListener
.The application can respond to this information request later using
Core.addAuthInfo(org.linphone.core.AuthInfo)
. This will unblock all pending authentication transactions and retry them with
authentication headers.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAvailableAlgorithm
(String algorithm) Add an unique algorithm in the the available algorithms list : Algorithms that
already exist will not be added.void
Remove all algorithms from the available algorithms list.clone()
Instantiates a new auth info with values from source.Gets the algorithm.String[]
Gets all available algorithms.Gets the domain.getHa1()
Gets the ha1.long
Gets the native pointer used by this class to make native method calls.Gets the password.getRealm()
Gets the realm.Gets the TLS certificate.Gets the TLS certificate path.Gets the TLS key.Gets the TLS key path.Gets the object stored in this object user's dataGets the user id.Gets the username.boolean
isEqualButAlgorithms
(AuthInfo authInfo2) Check if Authinfos are the same without taking account algorithms.void
setAlgorithm
(String algorithm) Sets the algorithm to use.void
setAvailableAlgorithms
(String[] algorithms) Sets the available algorithms list without testing unicity.void
Sets the domain for which this authentication is valid.void
Sets the ha1.void
setPassword
(String password) Sets the password.void
Sets the realm.void
setTlsCert
(String tlsCert) Sets the TLS certificate.void
setTlsCertPath
(String tlsCertPath) Sets the TLS certificate path.void
Sets the TLS key.void
setTlsKeyPath
(String tlsKeyPath) Sets the TLS key path.void
setUserData
(Object data) Sets the object to store in this object user's datavoid
Sets the user ID.void
setUsername
(String username) Sets the username.toString()
-
Method Details
-
getAlgorithm
Gets the algorithm.
- Returns:
- The algorithm.
-
setAlgorithm
Sets the algorithm to use.
- Parameters:
algorithm
- The algorithm.
-
getAvailableAlgorithms
Gets all available algorithms.
- Returns:
- A list of available algorithms.
-
setAvailableAlgorithms
Sets the available algorithms list without testing unicity.
- Parameters:
algorithms
- The available algorithms list.
-
getDomain
Gets the domain.
- Returns:
- The domain.
-
setDomain
Sets the domain for which this authentication is valid.
- Parameters:
domain
- The domain. This should not be necessary because realm is
supposed to be unique and sufficient. However, many SIP servers don't set realm
correctly, then domain has to be used to distinguish between several SIP
account bearing the same username.
-
getHa1
Gets the ha1.
- Returns:
- The ha1.
-
setHa1
Sets the ha1.
- Parameters:
ha1
- The ha1.
-
getPassword
Gets the password.
- Returns:
- The password.
-
setPassword
Sets the password.
- Parameters:
password
- The password.
-
getRealm
Gets the realm.
- Returns:
- The realm.
-
setRealm
Sets the realm.
- Parameters:
realm
- The realm.
-
getTlsCert
Gets the TLS certificate.
- Returns:
- The TLS certificate.
-
setTlsCert
Sets the TLS certificate.
- Parameters:
tlsCert
- The TLS certificate.
-
getTlsCertPath
Gets the TLS certificate path.
- Returns:
- The TLS certificate path.
-
setTlsCertPath
Sets the TLS certificate path.
- Parameters:
tlsCertPath
- The TLS certificate path.
-
getTlsKey
Gets the TLS key.
- Returns:
- The TLS key.
-
setTlsKey
Sets the TLS key.
- Parameters:
tlsKey
- The TLS key.
-
getTlsKeyPath
Gets the TLS key path.
- Returns:
- The TLS key path.
-
setTlsKeyPath
Sets the TLS key path.
- Parameters:
tlsKeyPath
- The TLS key path.
-
getUserid
Gets the user id.
- Returns:
- The user id.
-
setUserid
Sets the user ID.
- Parameters:
userId
- The userid.
-
getUsername
Gets the username.
- Returns:
- The username.
-
setUsername
Sets the username.
- Parameters:
username
- The username.
-
addAvailableAlgorithm
Add an unique algorithm in the the available algorithms list : Algorithms that
already exist will not be added.
- Parameters:
algorithm
- The algorithm to add.
-
clearAvailableAlgorithms
void clearAvailableAlgorithms()Remove all algorithms from the available algorithms list.
-
clone
Instantiates a new auth info with values from source.
- Returns:
- The newly created
AuthInfo
object.
-
isEqualButAlgorithms
Check if Authinfos are the same without taking account algorithms.
- Parameters:
authInfo2
- The secondAuthInfo
object.- Returns:
- true if all fields (Username, UserId, Realm, Domain) are the same.
-
setUserData
Sets the object to store in this object user's data- Parameters:
data
- the object to store
-
getUserData
Object getUserData()Gets the object stored in this object user's data- Returns:
- the object store if any, null otherwise
-
getNativePointer
long getNativePointer()Gets the native pointer used by this class to make native method calls.- Returns:
- the nativer pointer, as long
-
toString
String toString()
-