Gets or sets the ICredentialsProvider, which provides the user credentials that
StreamLink uses to log in to a Liberator server.
![](../icons/collapse_all.gif)
C# | Visual Basic | Visual C++ |
public ICredentialsProvider CredentialsProvider { get; set; }
Public Property CredentialsProvider As ICredentialsProvider
public: property ICredentialsProvider^ CredentialsProvider { ICredentialsProvider^ get (); void set (ICredentialsProvider^ value); }
![](../icons/collapse_all.gif)
The ICredentialsProvider.
![](../icons/collapse_all.gif)
StreamLink uses the ICredentialsProvider to retrieve the user credentials needed to log in to Liberator.
The application must register an ICredentialsProvider with StreamLink by setting the CredentialsProvider property of the StreamLink object, otherwise StreamLink will report a login failure when it tries to connect to the Liberator.
![](../icons/collapse_all.gif)
![](../icons/CopyCode.gif)
using System; using System.Collections.Generic; using System.Text; namespace Caplin.StreamLink.Authentication { /// <summary> /// Implements a credentials provider with a non-changing username and password /// </summary> public class CredentialsProvider : ICredentialsProvider { private string _password; private string _username; /// <summary> /// Initializes a new instance of the PasswordCredentials class. /// </summary> /// <param name="username">The username.</param> /// <param name="password">The password.</param> public CredentialsProvider(string username, string password) { _username = username; _password = password; } #region ICredentialsProvider Members /// <summary> /// Gets the credentials used to login to the Liberator. /// </summary> /// <value>The credentials.</value> public ICredentials Credentials { get { return new Credentials(_username, _password); } } #endregion } }