Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CPasswordManager Class Reference

Password Manager class for saving authentication details. More...

#include <PasswordManager.h>

Public Member Functions

bool AuthenticateURL (CURL &url)
 Authenticate a URL by looking the URL up in the temporary and permanent caches First looks up based on host and share name. If that fails, it will try a match purely on the host name (eg different shares on the same host with the same credentials)
 
bool PromptToAuthenticateURL (CURL &url)
 Prompt for a username and password for the particular URL.
 
void SaveAuthenticatedURL (const CURL &url, bool saveToProfile=true)
 Save an authenticated URL.
 
bool IsURLSupported (const CURL &url)
 Is an URL is supported (by the manager)
 
void Clear ()
 Clear any previously cached passwords.
 

Static Public Member Functions

static CPasswordManagerGetInstance ()
 The only way through which the global instance of the CPasswordManager should be accessed.
 

Detailed Description

Password Manager class for saving authentication details.

Handles access to previously saved passwords for paths, translating normal URLs into authenticated URLs if the user has details about the username and password for a path previously saved. Should be accessed via CPasswordManager::GetInstance()

Member Function Documentation

◆ AuthenticateURL()

bool CPasswordManager::AuthenticateURL ( CURL & url)

Authenticate a URL by looking the URL up in the temporary and permanent caches First looks up based on host and share name. If that fails, it will try a match purely on the host name (eg different shares on the same host with the same credentials)

Parameters
urla CURL to authenticate
Returns
true if we have details in the cache, false otherwise.
See also
CURL

◆ Clear()

void CPasswordManager::Clear ( )

Clear any previously cached passwords.

◆ GetInstance()

CPasswordManager & CPasswordManager::GetInstance ( )
static

The only way through which the global instance of the CPasswordManager should be accessed.

Returns
the global instance.

◆ IsURLSupported()

bool CPasswordManager::IsURLSupported ( const CURL & url)

Is an URL is supported (by the manager)

This routine checks that an URL is supported by the manager

Parameters
urlthe URL to check.
Returns
true if the URL is supported
See also
CURL, IsURLSupported

◆ PromptToAuthenticateURL()

bool CPasswordManager::PromptToAuthenticateURL ( CURL & url)

Prompt for a username and password for the particular URL.

This routine pops up a dialog, requesting the user enter a username and password to access the given URL. The user may optionally save these details. If saved we write the details into the users profile. If not saved, the details are temporarily stored so that further access no longer requires prompting for authentication.

Parameters
urlthe URL to authenticate.
Returns
true if the user entered details, false if the user cancelled the dialog.
See also
CURL, SaveAuthenticatedURL

◆ SaveAuthenticatedURL()

void CPasswordManager::SaveAuthenticatedURL ( const CURL & url,
bool saveToProfile = true )

Save an authenticated URL.

This routine stores an authenticated URL in the temporary cache, and optionally saves these details into the users profile.

Parameters
urlthe URL to authenticate.
saveToProfilewhether to save in the users profile, defaults to true.
See also
CURL, PromptToAuthenticateURL

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