Liblinphone: linphone::AuthInfo Class Reference

Liblinphone 5.2.0

Public Member Functions | List of all members
linphone::AuthInfo Class Reference

Object holding authentication information. More...

`#include <auth_info.hh>`

Inheritance diagram for linphone::AuthInfo:

## Public Member Functions
LINPHONECXX_PUBLIC | AuthInfo (void *ptr, bool takeRef=true)
LINPHONECXX_PUBLIC _LinphoneAuthInfo * | cPtr ()
LINPHONECXX_PUBLIC std::string | getAlgorithm () const
| Gets the algorithm.
LINPHONECXX_PUBLIC void | setAlgorithm (const std::string &algorithm)
| Sets the algorithm to use.
LINPHONECXX_PUBLIC std::list< std::string > | getAvailableAlgorithms () const
| Gets all available algorithms.
LINPHONECXX_PUBLIC void | setAvailableAlgorithms (const std::list< std::string > &algorithms)
| Sets the available algorithms list without testing unicity.
LINPHONECXX_PUBLIC std::string | getDomain () const
| Gets the domain.
LINPHONECXX_PUBLIC void | setDomain (const std::string &domain)
| Sets the domain for which this authentication is valid.
LINPHONECXX_PUBLIC std::string | getHa1 () const
| Gets the ha1.
LINPHONECXX_PUBLIC void | setHa1 (const std::string &ha1)
| Sets the ha1.
LINPHONECXX_PUBLIC std::string | getPassword () const
| Gets the password.
LINPHONECXX_PUBLIC void | setPassword (const std::string &password)
| Sets the password.
LINPHONECXX_PUBLIC std::string | getRealm () const
| Gets the realm.
LINPHONECXX_PUBLIC void | setRealm (const std::string &realm)
| Sets the realm.
LINPHONECXX_PUBLIC std::string | getTlsCert () const
| Gets the TLS certificate.
LINPHONECXX_PUBLIC void | setTlsCert (const std::string &tlsCert)
| Sets the TLS certificate.
LINPHONECXX_PUBLIC std::string | getTlsCertPath () const
| Gets the TLS certificate path.
LINPHONECXX_PUBLIC void | setTlsCertPath (const std::string &tlsCertPath)
| Sets the TLS certificate path.
LINPHONECXX_PUBLIC std::string | getTlsKey () const
| Gets the TLS key.
LINPHONECXX_PUBLIC void | setTlsKey (const std::string &tlsKey)
| Sets the TLS key.
LINPHONECXX_PUBLIC std::string | getTlsKeyPath () const
| Gets the TLS key path.
LINPHONECXX_PUBLIC void | setTlsKeyPath (const std::string &tlsKeyPath)
| Sets the TLS key path.
LINPHONECXX_PUBLIC std::string | getUserid () const
| Gets the user id.
LINPHONECXX_PUBLIC void | setUserid (const std::string &userId)
| Sets the user ID.
LINPHONECXX_PUBLIC std::string | getUsername () const
| Gets the username.
LINPHONECXX_PUBLIC void | setUsername (const std::string &username)
| Sets the username.
LINPHONECXX_PUBLIC void | addAvailableAlgorithm (const std::string &algorithm)
| Add an unique algorithm in the the available algorithms list : Algorithms that already exist will not be added.
LINPHONECXX_PUBLIC void | clearAvailableAlgorithms ()
| Remove all algorithms from the available algorithms list.
LINPHONECXX_PUBLIC std::shared_ptr< linphone::AuthInfo > | clone () const
| Instantiates a new auth info with values from source.
LINPHONECXX_PUBLIC bool | isEqualButAlgorithms (const std::shared_ptr< const linphone::AuthInfo > &authInfo2) const
| Check if Authinfos are the same without taking account algorithms.

## Detailed Description

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() 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 LinphoneCoreCbs. The application can respond to this information request later using Core::addAuthInfo(). This will unblock all pending authentication transactions and retry them with authentication headers.

## Member Function Documentation

## ◆ addAvailableAlgorithm()

LINPHONECXX_PUBLIC void linphone::AuthInfo::addAvailableAlgorithm | ( | const std::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.

## ◆ clone()

LINPHONECXX_PUBLIC std::shared_ptr< linphone::AuthInfo > linphone::AuthInfo::clone | ( |  | ) | const

Instantiates a new auth info with values from source.

Returns
  The newly created AuthInfo object.

## ◆ getAlgorithm()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getAlgorithm | ( |  | ) | const

Gets the algorithm.

Returns
  The algorithm.

## ◆ getAvailableAlgorithms()

LINPHONECXX_PUBLIC std::list< std::string > linphone::AuthInfo::getAvailableAlgorithms | ( |  | ) | const

Gets all available algorithms.

Returns
  A list of available algorithms.

## ◆ getDomain()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getDomain | ( |  | ) | const

Gets the domain.

Returns
  The domain.

## ◆ getHa1()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getHa1 | ( |  | ) | const

Gets the ha1.

Returns
  The ha1.

## ◆ getPassword()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getPassword | ( |  | ) | const

Gets the password.

Returns
  The password.

## ◆ getRealm()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getRealm | ( |  | ) | const

Gets the realm.

Returns
  The realm.

## ◆ getTlsCert()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getTlsCert | ( |  | ) | const

Gets the TLS certificate.

Returns
  The TLS certificate.

## ◆ getTlsCertPath()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getTlsCertPath | ( |  | ) | const

Gets the TLS certificate path.

Returns
  The TLS certificate path.

## ◆ getTlsKey()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getTlsKey | ( |  | ) | const

Gets the TLS key.

Returns
  The TLS key.

## ◆ getTlsKeyPath()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getTlsKeyPath | ( |  | ) | const

Gets the TLS key path.

Returns
  The TLS key path.

## ◆ getUserid()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getUserid | ( |  | ) | const

Gets the user id.

Returns
  The user id.

## ◆ getUsername()

LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getUsername | ( |  | ) | const

Gets the username.

Returns
  The username.

## ◆ isEqualButAlgorithms()

LINPHONECXX_PUBLIC bool linphone::AuthInfo::isEqualButAlgorithms | ( | const std::shared_ptr< const linphone::AuthInfo > & | authInfo2 | ) | const

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.

## ◆ setAlgorithm()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setAlgorithm | ( | const std::string & | algorithm | ) |

Sets the algorithm to use.

Parameters

  algorithm | The algorithm.

## ◆ setAvailableAlgorithms()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setAvailableAlgorithms | ( | const std::list< std::string > & | algorithms | ) |

Sets the available algorithms list without testing unicity.

Parameters

  algorithms | The available algorithms list.

## ◆ setDomain()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setDomain | ( | const std::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.

## ◆ setHa1()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setHa1 | ( | const std::string & | ha1 | ) |

Sets the ha1.

Parameters

  ha1 | The ha1.

## ◆ setPassword()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setPassword | ( | const std::string & | password | ) |

Sets the password.

Parameters

  password | The password.

## ◆ setRealm()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setRealm | ( | const std::string & | realm | ) |

Sets the realm.

Parameters

  realm | The realm.

## ◆ setTlsCert()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setTlsCert | ( | const std::string & | tlsCert | ) |

Sets the TLS certificate.

Parameters

  tlsCert | The TLS certificate.

## ◆ setTlsCertPath()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setTlsCertPath | ( | const std::string & | tlsCertPath | ) |

Sets the TLS certificate path.

Parameters

  tlsCertPath | The TLS certificate path.

## ◆ setTlsKey()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setTlsKey | ( | const std::string & | tlsKey | ) |

Sets the TLS key.

Parameters

  tlsKey | The TLS key.

## ◆ setTlsKeyPath()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setTlsKeyPath | ( | const std::string & | tlsKeyPath | ) |

Sets the TLS key path.

Parameters

  tlsKeyPath | The TLS key path.

## ◆ setUserid()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setUserid | ( | const std::string & | userId | ) |

Sets the user ID.

Parameters

  userId | The userid.

## ◆ setUsername()

LINPHONECXX_PUBLIC void linphone::AuthInfo::setUsername | ( | const std::string & | username | ) |

Sets the username.

Parameters

  username | The username.

The documentation for this class was generated from the following file:

- auth_info.hh