Liblinphone
5.4.0
|
Managing authentication: userid and passwords. More...
Typedefs | |
typedef struct _LinphoneAuthInfo | LinphoneAuthInfo |
Object holding authentication information. More... | |
typedef struct _LinphoneBearerToken | LinphoneBearerToken |
Object that represents a bearer token (eg OAUTH). More... | |
Functions | |
void | linphone_core_add_auth_info (LinphoneCore *core, const LinphoneAuthInfo *info) |
Adds authentication information to the LinphoneCore. More... | |
void | linphone_core_remove_auth_info (LinphoneCore *core, const LinphoneAuthInfo *info) |
Removes an authentication information object. More... | |
const bctbx_list_t * | linphone_core_get_auth_info_list (const LinphoneCore *core) |
Returns an unmodifiable list of currently entered LinphoneAuthInfo. More... | |
const LinphoneAuthInfo * | linphone_core_find_auth_info (LinphoneCore *core, const char *realm, const char *username, const char *sip_domain) |
Finds authentication info matching realm, username, domain criteria. More... | |
void | linphone_core_abort_authentication (LinphoneCore *core, const LinphoneAuthInfo *info) |
This method is used to abort a user authentication request initiated by LinphoneCore from the authentication_requested callback of LinphoneCoreCbs. More... | |
void | linphone_core_clear_all_auth_info (LinphoneCore *core) |
Clears all authentication information. More... | |
void | linphone_core_set_digest_authentication_policy (LinphoneCore *core, LinphoneDigestAuthenticationPolicy *policy) |
Setup a new digest authentication policy applicable for SIP and HTTP. More... | |
const LinphoneDigestAuthenticationPolicy * | linphone_core_get_digest_authentication_policy (const LinphoneCore *core) |
Get the current digest authentication policy applicable for SIP and HTTP. More... | |
MS2_DEPRECATED LinphoneAuthInfo * | linphone_core_create_auth_info (LinphoneCore *core, const char *username, const char *userid, const char *passwd, const char *ha1, const char *realm, const char *domain) |
Create an authentication information with default values from Linphone core. More... | |
LinphoneAuthInfo * | linphone_auth_info_new (const char *username, const char *userid, const char *passwd, const char *ha1, const char *realm, const char *domain) |
LinphoneAuthInfo * | linphone_auth_info_new_for_algorithm (const char *username, const char *userid, const char *passwd, const char *ha1, const char *realm, const char *domain, const char *algorithm) |
LinphoneAuthInfo * | linphone_auth_info_clone (const LinphoneAuthInfo *auth_info) |
Instantiates a new auth info with values from source. More... | |
LinphoneAuthInfo * | linphone_auth_info_ref (LinphoneAuthInfo *auth_info) |
Take a reference on a LinphoneAuthInfo. More... | |
void | linphone_auth_info_unref (LinphoneAuthInfo *auth_info) |
Release a LinphoneAuthInfo. More... | |
void | linphone_auth_info_set_password (LinphoneAuthInfo *auth_info, const char *password) |
Sets the password. More... | |
void | linphone_auth_info_set_username (LinphoneAuthInfo *auth_info, const char *username) |
Sets the username. More... | |
void | linphone_auth_info_set_algorithm (LinphoneAuthInfo *auth_info, const char *algorithm) |
Sets the algorithm to use. More... | |
void | linphone_auth_info_set_available_algorithms (LinphoneAuthInfo *auth_info, const bctbx_list_t *algorithms) |
Sets the available algorithms list without testing unicity. More... | |
void | linphone_auth_info_add_available_algorithm (LinphoneAuthInfo *auth_info, const char *algorithm) |
Add an unique algorithm in the the available algorithms list : Algorithms that already exist will not be added. More... | |
void | linphone_auth_info_set_userid (LinphoneAuthInfo *auth_info, const char *user_id) |
Sets the user ID. More... | |
void | linphone_auth_info_set_realm (LinphoneAuthInfo *auth_info, const char *realm) |
Sets the realm. More... | |
void | linphone_auth_info_set_domain (LinphoneAuthInfo *auth_info, const char *domain) |
Sets the domain for which this authentication is valid. More... | |
void | linphone_auth_info_set_ha1 (LinphoneAuthInfo *auth_info, const char *ha1) |
Sets the ha1. More... | |
void | linphone_auth_info_set_tls_cert (LinphoneAuthInfo *auth_info, const char *tls_cert) |
Sets the TLS certificate. More... | |
void | linphone_auth_info_set_tls_key (LinphoneAuthInfo *auth_info, const char *tls_key) |
Sets the TLS key. More... | |
void | linphone_auth_info_set_tls_cert_path (LinphoneAuthInfo *auth_info, const char *tls_cert_path) |
Sets the TLS certificate path. More... | |
void | linphone_auth_info_set_tls_key_path (LinphoneAuthInfo *auth_info, const char *tls_key_path) |
Sets the TLS key path. More... | |
void | linphone_auth_info_clear_available_algorithms (LinphoneAuthInfo *auth_info) |
Remove all algorithms from the available algorithms list. More... | |
void | linphone_auth_info_set_tls_key_password (LinphoneAuthInfo *auth_info, const char *tls_key_password) |
const char * | linphone_auth_info_get_username (const LinphoneAuthInfo *auth_info) |
Gets the username. More... | |
const char * | linphone_auth_info_get_algorithm (const LinphoneAuthInfo *auth_info) |
Gets the algorithm. More... | |
bctbx_list_t * | linphone_auth_info_get_available_algorithms (const LinphoneAuthInfo *auth_info) |
Gets all available algorithms. More... | |
const char * | linphone_auth_info_get_password (const LinphoneAuthInfo *auth_info) |
Gets the password. More... | |
const char * | linphone_auth_info_get_userid (const LinphoneAuthInfo *auth_info) |
Gets the user id. More... | |
const char * | linphone_auth_info_get_realm (const LinphoneAuthInfo *auth_info) |
Gets the realm. More... | |
const char * | linphone_auth_info_get_domain (const LinphoneAuthInfo *auth_info) |
Gets the domain. More... | |
const char * | linphone_auth_info_get_ha1 (const LinphoneAuthInfo *auth_info) |
Gets the ha1. More... | |
const char * | linphone_auth_info_get_tls_cert (const LinphoneAuthInfo *auth_info) |
Gets the TLS certificate. More... | |
const char * | linphone_auth_info_get_tls_key (const LinphoneAuthInfo *auth_info) |
Gets the TLS key. More... | |
const char * | linphone_auth_info_get_tls_cert_path (const LinphoneAuthInfo *auth_info) |
Gets the TLS certificate path. More... | |
const char * | linphone_auth_info_get_tls_key_path (const LinphoneAuthInfo *auth_info) |
Gets the TLS key path. More... | |
const char * | linphone_auth_info_get_tls_key_password (const LinphoneAuthInfo *auth_info) |
bool_t | linphone_auth_info_is_equal_but_algorithms (const LinphoneAuthInfo *auth_info_1, const LinphoneAuthInfo *auth_info_2) |
Check if Authinfos are the same without taking account algorithms. More... | |
const LinphoneBearerToken * | linphone_auth_info_get_access_token (const LinphoneAuthInfo *auth_info) |
Return a previously set access token. More... | |
const LinphoneBearerToken * | linphone_auth_info_get_refresh_token (const LinphoneAuthInfo *auth_info) |
Return a previously set refresh token. More... | |
void | linphone_auth_info_set_access_token (LinphoneAuthInfo *auth_info, LinphoneBearerToken *token) |
Set an access token to authenticate, to be used when the server supports the "bearer" authentication method. More... | |
void | linphone_auth_info_set_refresh_token (LinphoneAuthInfo *auth_info, LinphoneBearerToken *token) |
Set a refresh token to use when the access token set with linphone_auth_info_set_access_token() expires. More... | |
void | linphone_auth_info_set_authorization_server (LinphoneAuthInfo *auth_info, const char *uri) |
Set the authorization server uri. More... | |
const char * | linphone_auth_info_get_authorization_server (const LinphoneAuthInfo *auth_info) |
Get the previously set authorization server uri. More... | |
const char * | linphone_auth_info_get_token_endpoint_uri (const LinphoneAuthInfo *auth_info) |
Get the previously set token endpoint https uri (OAUTH2). More... | |
void | linphone_auth_info_set_token_endpoint_uri (LinphoneAuthInfo *auth_info, const char *uri) |
Set the token endpoint https uri (OAUTH2). More... | |
const char * | linphone_auth_info_get_client_id (const LinphoneAuthInfo *auth_info) |
Get the previously set OAUTH2 client_id. More... | |
void | linphone_auth_info_set_client_id (LinphoneAuthInfo *auth_info, const char *client_id) |
Set the OAUTH2 client_id. More... | |
const char * | linphone_auth_info_get_client_secret (const LinphoneAuthInfo *auth_info) |
Get the previously set OAUTH2 client_secret. More... | |
void | linphone_auth_info_set_client_secret (LinphoneAuthInfo *auth_info, const char *client_secret) |
Set the OAUTH2 client_secret. More... | |
time_t | linphone_auth_info_get_expires (const LinphoneAuthInfo *auth_info) |
Get the expiration time for the current authentication information. More... | |
void | linphone_auth_info_set_expires (LinphoneAuthInfo *auth_info, time_t expires) |
Set the expiration time for the current authentication information. More... | |
MS2_DEPRECATED void | linphone_auth_info_set_passwd (LinphoneAuthInfo *auth_info, const char *passwd) |
Sets the password. More... | |
MS2_DEPRECATED const char * | linphone_auth_info_get_passwd (const LinphoneAuthInfo *auth_info) |
Gets the password. More... | |
MS2_DEPRECATED void | linphone_auth_info_destroy (LinphoneAuthInfo *auth_info) |
Destroys the auth info. More... | |
LinphoneDigestAuthenticationPolicy * | linphone_digest_authentication_policy_ref (LinphoneDigestAuthenticationPolicy *policy) |
Acquire a reference. More... | |
void | linphone_digest_authentication_policy_unref (LinphoneDigestAuthenticationPolicy *policy) |
Release reference. More... | |
void | linphone_digest_authentication_policy_set_allow_md5 (LinphoneDigestAuthenticationPolicy *policy, bool_t value) |
Set whether MD5 hash algorithm is allowed. More... | |
bool_t | linphone_digest_authentication_policy_get_allow_md5 (const LinphoneDigestAuthenticationPolicy *policy) |
Get whether MD5 hash algorithm is allowed. More... | |
void | linphone_digest_authentication_policy_set_allow_no_qop (LinphoneDigestAuthenticationPolicy *policy, bool_t value) |
Set whether digest authentication without 'qop=auth' mode is allowed. More... | |
bool_t | linphone_digest_authentication_policy_get_allow_no_qop (const LinphoneDigestAuthenticationPolicy *policy) |
Get whether digest authentication without 'qop=auth' mode is allowed. More... | |
void * | linphone_digest_authentication_policy_get_user_data (const LinphoneDigestAuthenticationPolicy *policy) |
Retrieve the user pointer associated with the LinphoneDigestAuthenticationPolicy object. More... | |
void | linphone_digest_authentication_policy_set_user_data (LinphoneDigestAuthenticationPolicy *policy, void *user_data) |
Assign a user pointer to the LinphoneDigestAuthenticationPolicy object. More... | |
const char * | linphone_bearer_token_get_token (const LinphoneBearerToken *obj) |
Get the token as a string. More... | |
time_t | linphone_bearer_token_get_expiration_time (const LinphoneBearerToken *obj) |
Get the token exiration time, as a number of seconds since EPOCH. More... | |
LinphoneBearerToken * | linphone_bearer_token_ref (LinphoneBearerToken *obj) |
Increment the reference count of the token object. More... | |
void | linphone_bearer_token_unref (LinphoneBearerToken *obj) |
Decrement the reference count of the token object, which may free it. More... | |
Managing authentication: userid and passwords.
typedef struct _LinphoneAuthInfo LinphoneAuthInfo |
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 LinphoneAuthInfo must be added to the LinphoneCore in order to become known and used automatically when needed. Use linphone_core_add_auth_info() for that purpose.
The LinphoneCore 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 linphone_core_add_auth_info(). This will unblock all pending authentication transactions and retry them with authentication headers.
typedef struct _LinphoneBearerToken LinphoneBearerToken |
Object that represents a bearer token (eg OAUTH).
SIP servers may support "bearer" kind of authentication, in which case an authentication token needs to be supplied in order to authenticate to the SIP service. Applications are responsible to obtain the token from an authentication server. In order to pass it to liblinphone for usage, the token needs to be encapsulated into a LinphoneBearerToken, together with its expiration time and target server name for which it is intended to use, then passed into a LinphoneAuthInfo object. Both access and refresh tokens may be represented. If both are provided to the LinphoneAuthInfo, then liblinphone automatically uses the refresh token to obtain a new access token when the latter is expired.
void linphone_auth_info_add_available_algorithm | ( | LinphoneAuthInfo * | auth_info, |
const char * | algorithm | ||
) |
Add an unique algorithm in the the available algorithms list : Algorithms that already exist will not be added.
auth_info | The LinphoneAuthInfo object. |
algorithm | The algorithm to add. |
void linphone_auth_info_clear_available_algorithms | ( | LinphoneAuthInfo * | auth_info | ) |
Remove all algorithms from the available algorithms list.
auth_info | The LinphoneAuthInfo object. |
LinphoneAuthInfo* linphone_auth_info_clone | ( | const LinphoneAuthInfo * | auth_info | ) |
Instantiates a new auth info with values from source.
auth_info | The LinphoneAuthInfo object to be cloned. |
MS2_DEPRECATED void linphone_auth_info_destroy | ( | LinphoneAuthInfo * | auth_info | ) |
Destroys the auth info.
auth_info | The LinphoneAuthInfo object. |
const LinphoneBearerToken* linphone_auth_info_get_access_token | ( | const LinphoneAuthInfo * | auth_info | ) |
Return a previously set access token.
auth_info | The LinphoneAuthInfo object. |
const char* linphone_auth_info_get_algorithm | ( | const LinphoneAuthInfo * | auth_info | ) |
const char* linphone_auth_info_get_authorization_server | ( | const LinphoneAuthInfo * | auth_info | ) |
Get the previously set authorization server uri.
auth_info | The LinphoneAuthInfo object. |
bctbx_list_t* linphone_auth_info_get_available_algorithms | ( | const LinphoneAuthInfo * | auth_info | ) |
Gets all available algorithms.
auth_info | The LinphoneAuthInfo object. |
const char* linphone_auth_info_get_client_id | ( | const LinphoneAuthInfo * | auth_info | ) |
Get the previously set OAUTH2 client_id.
auth_info | The LinphoneAuthInfo object. |
const char* linphone_auth_info_get_client_secret | ( | const LinphoneAuthInfo * | auth_info | ) |
Get the previously set OAUTH2 client_secret.
auth_info | The LinphoneAuthInfo object. |
const char* linphone_auth_info_get_domain | ( | const LinphoneAuthInfo * | auth_info | ) |
time_t linphone_auth_info_get_expires | ( | const LinphoneAuthInfo * | auth_info | ) |
Get the expiration time for the current authentication information.
auth_info | The LinphoneAuthInfo object. |
const char* linphone_auth_info_get_ha1 | ( | const LinphoneAuthInfo * | auth_info | ) |
MS2_DEPRECATED const char* linphone_auth_info_get_passwd | ( | const LinphoneAuthInfo * | auth_info | ) |
Gets the password.
auth_info | The LinphoneAuthInfo object. |
const char* linphone_auth_info_get_password | ( | const LinphoneAuthInfo * | auth_info | ) |
const char* linphone_auth_info_get_realm | ( | const LinphoneAuthInfo * | auth_info | ) |
const LinphoneBearerToken* linphone_auth_info_get_refresh_token | ( | const LinphoneAuthInfo * | auth_info | ) |
Return a previously set refresh token.
auth_info | The LinphoneAuthInfo object. |
const char* linphone_auth_info_get_tls_cert | ( | const LinphoneAuthInfo * | auth_info | ) |
Gets the TLS certificate.
auth_info | The LinphoneAuthInfo object. |
const char* linphone_auth_info_get_tls_cert_path | ( | const LinphoneAuthInfo * | auth_info | ) |
Gets the TLS certificate path.
auth_info | The LinphoneAuthInfo object. |
const char* linphone_auth_info_get_tls_key | ( | const LinphoneAuthInfo * | auth_info | ) |
const char* linphone_auth_info_get_tls_key_path | ( | const LinphoneAuthInfo * | auth_info | ) |
const char* linphone_auth_info_get_token_endpoint_uri | ( | const LinphoneAuthInfo * | auth_info | ) |
Get the previously set token endpoint https uri (OAUTH2).
auth_info | The LinphoneAuthInfo object. |
const char* linphone_auth_info_get_userid | ( | const LinphoneAuthInfo * | auth_info | ) |
const char* linphone_auth_info_get_username | ( | const LinphoneAuthInfo * | auth_info | ) |
bool_t linphone_auth_info_is_equal_but_algorithms | ( | const LinphoneAuthInfo * | auth_info_1, |
const LinphoneAuthInfo * | auth_info_2 | ||
) |
Check if Authinfos are the same without taking account algorithms.
auth_info_1 | The first LinphoneAuthInfo object. |
auth_info_2 | The second LinphoneAuthInfo object. |
LinphoneAuthInfo* linphone_auth_info_ref | ( | LinphoneAuthInfo * | auth_info | ) |
Take a reference on a LinphoneAuthInfo.
auth_info | The LinphoneAuthInfo object. |
void linphone_auth_info_set_access_token | ( | LinphoneAuthInfo * | auth_info, |
LinphoneBearerToken * | token | ||
) |
Set an access token to authenticate, to be used when the server supports the "bearer" authentication method.
The LinphoneAuthInfo takes a reference to the supplied token, it is not making any copy.
auth_info | The LinphoneAuthInfo object |
token | The LinphoneBearerToken object representing the access token. |
void linphone_auth_info_set_algorithm | ( | LinphoneAuthInfo * | auth_info, |
const char * | algorithm | ||
) |
Sets the algorithm to use.
auth_info | The LinphoneAuthInfo object. |
algorithm | The algorithm. |
void linphone_auth_info_set_authorization_server | ( | LinphoneAuthInfo * | auth_info, |
const char * | uri | ||
) |
Set the authorization server uri.
auth_info | The LinphoneAuthInfo object. |
uri | the authorization server uri. |
void linphone_auth_info_set_available_algorithms | ( | LinphoneAuthInfo * | auth_info, |
const bctbx_list_t * | algorithms | ||
) |
Sets the available algorithms list without testing unicity.
auth_info | The LinphoneAuthInfo object. |
algorithms | The available algorithms list. |
void linphone_auth_info_set_client_id | ( | LinphoneAuthInfo * | auth_info, |
const char * | client_id | ||
) |
Set the OAUTH2 client_id.
The client_id may be used to renew access token from refresh token. If a client_secret is required, it has to be set through linphone_auth_info_set_client_secret().
auth_info | The LinphoneAuthInfo object. |
client_id | the client_id. |
void linphone_auth_info_set_client_secret | ( | LinphoneAuthInfo * | auth_info, |
const char * | client_secret | ||
) |
Set the OAUTH2 client_secret.
The client_secret may be used to renew access token from refresh token.
auth_info | The LinphoneAuthInfo object. |
client_secret | the client_secret. |
void linphone_auth_info_set_domain | ( | LinphoneAuthInfo * | auth_info, |
const char * | domain | ||
) |
Sets the domain for which this authentication is valid.
auth_info | The LinphoneAuthInfo object. |
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. |
void linphone_auth_info_set_expires | ( | LinphoneAuthInfo * | auth_info, |
time_t | expires | ||
) |
Set the expiration time for the current authentication information.
auth_info | The LinphoneAuthInfo object. |
expires | The new expiration time in seconds. Use 0 to indicate no expiration. |
void linphone_auth_info_set_ha1 | ( | LinphoneAuthInfo * | auth_info, |
const char * | ha1 | ||
) |
Sets the ha1.
auth_info | The LinphoneAuthInfo object. |
ha1 | The ha1. |
MS2_DEPRECATED void linphone_auth_info_set_passwd | ( | LinphoneAuthInfo * | auth_info, |
const char * | passwd | ||
) |
Sets the password.
auth_info | The LinphoneAuthInfo object. |
passwd | The password. |
void linphone_auth_info_set_password | ( | LinphoneAuthInfo * | auth_info, |
const char * | password | ||
) |
Sets the password.
auth_info | The LinphoneAuthInfo object. |
password | The password. |
void linphone_auth_info_set_realm | ( | LinphoneAuthInfo * | auth_info, |
const char * | realm | ||
) |
Sets the realm.
auth_info | The LinphoneAuthInfo object. |
realm | The realm. |
void linphone_auth_info_set_refresh_token | ( | LinphoneAuthInfo * | auth_info, |
LinphoneBearerToken * | token | ||
) |
Set a refresh token to use when the access token set with linphone_auth_info_set_access_token() expires.
The LinphoneAuthInfo takes a reference to the supplied token, it is not making any copy. Provided that the token endpoint uri was assigned with linphone_auth_info_set_token_endpoint_uri(), once the LinphoneAuthInfo is pushed in the LinphoneCore, LinphoneAuthInfo object automatically obtains new access token when needed, from the supplied refresh token.
auth_info | The LinphoneAuthInfo object |
token | The LinphoneBearerToken object representing the refresh token. |
void linphone_auth_info_set_tls_cert | ( | LinphoneAuthInfo * | auth_info, |
const char * | tls_cert | ||
) |
Sets the TLS certificate.
auth_info | The LinphoneAuthInfo object. |
tls_cert | The TLS certificate. |
void linphone_auth_info_set_tls_cert_path | ( | LinphoneAuthInfo * | auth_info, |
const char * | tls_cert_path | ||
) |
Sets the TLS certificate path.
auth_info | The LinphoneAuthInfo object. |
tls_cert_path | The TLS certificate path. |
void linphone_auth_info_set_tls_key | ( | LinphoneAuthInfo * | auth_info, |
const char * | tls_key | ||
) |
Sets the TLS key.
auth_info | The LinphoneAuthInfo object. |
tls_key | The TLS key. |
void linphone_auth_info_set_tls_key_path | ( | LinphoneAuthInfo * | auth_info, |
const char * | tls_key_path | ||
) |
Sets the TLS key path.
auth_info | The LinphoneAuthInfo object. |
tls_key_path | The TLS key path. |
void linphone_auth_info_set_token_endpoint_uri | ( | LinphoneAuthInfo * | auth_info, |
const char * | uri | ||
) |
Set the token endpoint https uri (OAUTH2).
The token endpoint uri is used to renew access token from refresh token.
auth_info | The LinphoneAuthInfo object. |
uri | the token endpoint uri. |
void linphone_auth_info_set_userid | ( | LinphoneAuthInfo * | auth_info, |
const char * | user_id | ||
) |
Sets the user ID.
auth_info | The LinphoneAuthInfo object. |
user_id | The userid. |
void linphone_auth_info_set_username | ( | LinphoneAuthInfo * | auth_info, |
const char * | username | ||
) |
Sets the username.
auth_info | The LinphoneAuthInfo object. |
username | The username. |
void linphone_auth_info_unref | ( | LinphoneAuthInfo * | auth_info | ) |
Release a LinphoneAuthInfo.
auth_info | The LinphoneAuthInfo object. |
time_t linphone_bearer_token_get_expiration_time | ( | const LinphoneBearerToken * | obj | ) |
Get the token exiration time, as a number of seconds since EPOCH.
obj | the LinphoneBearerToken |
const char* linphone_bearer_token_get_token | ( | const LinphoneBearerToken * | obj | ) |
LinphoneBearerToken* linphone_bearer_token_ref | ( | LinphoneBearerToken * | obj | ) |
Increment the reference count of the token object.
obj | the LinphoneBearerToken |
void linphone_bearer_token_unref | ( | LinphoneBearerToken * | obj | ) |
Decrement the reference count of the token object, which may free it.
obj | the LinphoneBearerToken |
void linphone_core_abort_authentication | ( | LinphoneCore * | core, |
const LinphoneAuthInfo * | info | ||
) |
This method is used to abort a user authentication request initiated by LinphoneCore from the authentication_requested callback of LinphoneCoreCbs.
core | the LinphoneCore |
info | the LinphoneAuthInfo for which to abort authentication |
void linphone_core_add_auth_info | ( | LinphoneCore * | core, |
const LinphoneAuthInfo * | info | ||
) |
Adds authentication information to the LinphoneCore.
These nformation will be used during all SIP or HTTP transactions that require authentication.
core | The LinphoneCore. |
info | The LinphoneAuthInfo to add. |
void linphone_core_clear_all_auth_info | ( | LinphoneCore * | core | ) |
Clears all authentication information.
core | the LinphoneCore |
MS2_DEPRECATED LinphoneAuthInfo* linphone_core_create_auth_info | ( | LinphoneCore * | core, |
const char * | username, | ||
const char * | userid, | ||
const char * | passwd, | ||
const char * | ha1, | ||
const char * | realm, | ||
const char * | domain | ||
) |
Create an authentication information with default values from Linphone core.
core | LinphoneCore object |
username | String containing the username part of the authentication credentials |
userid | String containing the username to use to calculate the authentication digest (optional) |
passwd | String containing the password of the authentication credentials (optional, either passwd or ha1 must be set) |
ha1 | String containing a ha1 hash of the password (optional, either passwd or ha1 must be set) |
realm | String used to discriminate different SIP authentication domains (optional) |
domain | String containing the SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain. |
const LinphoneAuthInfo* linphone_core_find_auth_info | ( | LinphoneCore * | core, |
const char * | realm, | ||
const char * | username, | ||
const char * | sip_domain | ||
) |
Finds authentication info matching realm, username, domain criteria.
First of all, (realm,username) pair are searched. If multiple results (which should not happen because realm are supposed to be unique), then domain is added to the search.
core | the LinphoneCore |
realm | the authentication 'realm' (optional) |
username | the SIP username to be authenticated (mandatory) |
sip_domain | the SIP domain name (optional) |
const bctbx_list_t* linphone_core_get_auth_info_list | ( | const LinphoneCore * | core | ) |
Returns an unmodifiable list of currently entered LinphoneAuthInfo.
core | The LinphoneCore object. |
const LinphoneDigestAuthenticationPolicy* linphone_core_get_digest_authentication_policy | ( | const LinphoneCore * | core | ) |
Get the current digest authentication policy applicable for SIP and HTTP.
core | the LinphoneCore |
void linphone_core_remove_auth_info | ( | LinphoneCore * | core, |
const LinphoneAuthInfo * | info | ||
) |
Removes an authentication information object.
core | The LinphoneCore from which the LinphoneAuthInfo will be removed. |
info | The LinphoneAuthInfo to remove. |
void linphone_core_set_digest_authentication_policy | ( | LinphoneCore * | core, |
LinphoneDigestAuthenticationPolicy * | policy | ||
) |
Setup a new digest authentication policy applicable for SIP and HTTP.
core | the LinphoneCore |
policy | a LinphoneDigestAuthenticationPolicy |
bool_t linphone_digest_authentication_policy_get_allow_md5 | ( | const LinphoneDigestAuthenticationPolicy * | policy | ) |
Get whether MD5 hash algorithm is allowed.
The default value is TRUE, in order to maximize interoperability. MD5 is considered as a weak algorithm, some might want to disable it, in which case SHA-256 will be required to perform digest authentication.
policy | The LinphoneDigestAuthenticationPolicy object. |
bool_t linphone_digest_authentication_policy_get_allow_no_qop | ( | const LinphoneDigestAuthenticationPolicy * | policy | ) |
Get whether digest authentication without 'qop=auth' mode is allowed.
The default value is TRUE, in order to maximize interoperability. 'qop=auth' mode enforces security thanks to the use of a client nonce, which makes password brute forcing more difficult. When set to FALSE, linphone will refuse to authenticate to servers that are not implementing the qop=auth mode.
policy | The LinphoneDigestAuthenticationPolicy object. |
void* linphone_digest_authentication_policy_get_user_data | ( | const LinphoneDigestAuthenticationPolicy * | policy | ) |
Retrieve the user pointer associated with the LinphoneDigestAuthenticationPolicy object.
policy | The LinphoneDigestAuthenticationPolicy object. |
LinphoneDigestAuthenticationPolicy* linphone_digest_authentication_policy_ref | ( | LinphoneDigestAuthenticationPolicy * | policy | ) |
Acquire a reference.
policy | The LinphoneDigestAuthenticationPolicy object. |
void linphone_digest_authentication_policy_set_allow_md5 | ( | LinphoneDigestAuthenticationPolicy * | policy, |
bool_t | value | ||
) |
Set whether MD5 hash algorithm is allowed.
The default value is TRUE, in order to maximize interoperability. MD5 is considered as a weak algorithm, some might want to disable it, in which case SHA-256 will be required to perform digest authentication.
policy | The LinphoneDigestAuthenticationPolicy object. |
value | a boolean value. |
void linphone_digest_authentication_policy_set_allow_no_qop | ( | LinphoneDigestAuthenticationPolicy * | policy, |
bool_t | value | ||
) |
Set whether digest authentication without 'qop=auth' mode is allowed.
The default value is TRUE, in order to maximize interoperability. 'qop=auth' mode enforces security thanks to the use of a client nonce, which makes password brute forcing more difficult. When set to FALSE, linphone will refuse to authenticate to servers that are not implementing the qop=auth mode.
policy | The LinphoneDigestAuthenticationPolicy object. |
value | a boolean value. |
void linphone_digest_authentication_policy_set_user_data | ( | LinphoneDigestAuthenticationPolicy * | policy, |
void * | user_data | ||
) |
Assign a user pointer to the LinphoneDigestAuthenticationPolicy object.
policy | The LinphoneDigestAuthenticationPolicy object. |
user_data | The user pointer. |
void linphone_digest_authentication_policy_unref | ( | LinphoneDigestAuthenticationPolicy * | policy | ) |
Release reference.
policy | The LinphoneDigestAuthenticationPolicy object. |