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 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 authentication
information 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 Details

    • getAlgorithm

      @Nullable String getAlgorithm()
      Gets the algorithm.

      Returns:
      The algorithm.
    • setAlgorithm

      void setAlgorithm(@Nullable String algorithm)
      Sets the algorithm to use.

      Parameters:
      algorithm - The algorithm.
    • getAvailableAlgorithms

      @NonNull String[] getAvailableAlgorithms()
      Gets all available algorithms.

      Returns:
      A list of available algorithms.
    • setAvailableAlgorithms

      void setAvailableAlgorithms(@Nullable String[] algorithms)
      Sets the available algorithms list without testing unicity.

      Parameters:
      algorithms - The available algorithms list.
    • getDomain

      @Nullable String getDomain()
      Gets the domain.

      Returns:
      The domain.
    • setDomain

      void setDomain(@Nullable String domain)
      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

      @Nullable String getHa1()
      Gets the ha1.

      Returns:
      The ha1.
    • setHa1

      void setHa1(@Nullable String ha1)
      Sets the ha1.

      Parameters:
      ha1 - The ha1.
    • getPassword

      @Nullable String getPassword()
      Gets the password.

      Returns:
      The password.
    • setPassword

      void setPassword(@Nullable String password)
      Sets the password.

      Parameters:
      password - The password.
    • getRealm

      @Nullable String getRealm()
      Gets the realm.

      Returns:
      The realm.
    • setRealm

      void setRealm(@Nullable String realm)
      Sets the realm.

      Parameters:
      realm - The realm.
    • getTlsCert

      @Nullable String getTlsCert()
      Gets the TLS certificate.

      Returns:
      The TLS certificate.
    • setTlsCert

      void setTlsCert(@Nullable String tlsCert)
      Sets the TLS certificate.

      Parameters:
      tlsCert - The TLS certificate.
    • getTlsCertPath

      @Nullable String getTlsCertPath()
      Gets the TLS certificate path.

      Returns:
      The TLS certificate path.
    • setTlsCertPath

      void setTlsCertPath(@Nullable String tlsCertPath)
      Sets the TLS certificate path.

      Parameters:
      tlsCertPath - The TLS certificate path.
    • getTlsKey

      @Nullable String getTlsKey()
      Gets the TLS key.

      Returns:
      The TLS key.
    • setTlsKey

      void setTlsKey(@Nullable String tlsKey)
      Sets the TLS key.

      Parameters:
      tlsKey - The TLS key.
    • getTlsKeyPath

      @Nullable String getTlsKeyPath()
      Gets the TLS key path.

      Returns:
      The TLS key path.
    • setTlsKeyPath

      void setTlsKeyPath(@Nullable String tlsKeyPath)
      Sets the TLS key path.

      Parameters:
      tlsKeyPath - The TLS key path.
    • getUserid

      @Nullable String getUserid()
      Gets the user id.

      Returns:
      The user id.
    • setUserid

      void setUserid(@Nullable String userId)
      Sets the user ID.

      Parameters:
      userId - The userid.
    • getUsername

      @Nullable String getUsername()
      Gets the username.

      Returns:
      The username.
    • setUsername

      void setUsername(@Nullable String username)
      Sets the username.

      Parameters:
      username - The username.
    • addAvailableAlgorithm

      void addAvailableAlgorithm(@Nullable String algorithm)
      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

      @NonNull AuthInfo clone()
      Instantiates a new auth info with values from source.

      Returns:
      The newly created AuthInfo object.
    • isEqualButAlgorithms

      boolean isEqualButAlgorithms(@Nullable AuthInfo authInfo2)
      Check if Authinfos are the same without taking account algorithms.

      Parameters:
      authInfo2 - The second AuthInfo object.
      Returns:
      true if all fields (Username, UserId, Realm, Domain) are the same.
    • setUserData

      void setUserData(Object data)
      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()
      Overrides:
      toString in class Object