C# | Visual Basic | Visual C++ |
public class StandardKeyMasterCredentialsProvider : KeyMasterCredentialsProvider, IConnectionListener
Public Class StandardKeyMasterCredentialsProvider _ Inherits KeyMasterCredentialsProvider _ Implements IConnectionListener
public ref class StandardKeyMasterCredentialsProvider : public KeyMasterCredentialsProvider, IConnectionListener
All Members | Constructors | Methods | |||
Icon | Member | Description |
---|---|---|
StandardKeyMasterCredentialsProvider(String, ICredentials, Int32) |
Constructs a StandardKeyMasterCredentialsProvider with a specified KeyMaster URI, credentials and request timeout period. If
this constructor is used then the StandardKeyMasterCredentialsProvider will not do any polling.
| |
StandardKeyMasterCredentialsProvider(String, ICredentials) |
Constructs a StandardKeyMasterCredentialsProvider with a specified KeyMaster URI, credentials and the default
request timeout of 10 seconds. If this constructor is used then the StandardKeyMasterCredentialsProvider will
not do any polling.
| |
StandardKeyMasterCredentialsProvider(String, ICredentials, Int32, StreamLink, Uri, Int64) |
Constructs a StandardKeyMasterCredentialsProvider with a specified KeyMaster URI, credentials and request
timeout period that performs polling. Polling is used to keep the KeyMaster session alive so that if StreamLink
reconnects and requests another token it does not have to reauthenticate.
| |
StandardKeyMasterCredentialsProvider(String, ICredentials, StreamLink, Uri, Int64) |
Constructs a StandardKeyMasterCredentialsProvider with a specified KeyMaster URI, credentials and the default request
timeout period of 10 seconds that performs polling. Polling is used to keep the KeyMaster session alive so that if StreamLink
reconnects and requests another token it does not have to reauthenticate.
| |
Equals(Object) | (Inherited from Object.) | |
Finalize()()() |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) | |
GetHashCode()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
GetType()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
MemberwiseClone()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
ToString()()() | (Inherited from Object.) |
In a typical setup, the Keymaster web application sits behind a login page or other authentication mechanism. The user logs into the Keymaster using the credentials required by the authentication mechanism. Once logged in, the user is able to access KeyMaster tokens. If required, the user may obtain further tokens from the KeyMaster, so long as they remain logged in (that is, so long as the the associated HTTP session remains valid).
If the additional polling requests that are typically required for HTTP session keep-alive are not desired or not required (because the
user's session will not time out) use the overloaded constructors that does not have a pollingInterval
0
pollingInterval
If the product in use is StreamLink for Silverlight then the application server that hosts KeyMaster must provide a valid clientaccesspolicy.xml/crossdomain.xml file in order to satisfy Silverlight security restrictions.
The constructors require an ICredentials object to be supplied with a non-null username. This corresponds to the
username that will be used to login to the Liberator and as such is mandatory. Should your deployment architecture have
KeyMaster accessible only via another webservice and that webservice sets the username on the KeyMaster request, you
will still need to supply a set of credentials to the constructor: new Credentials("DummyUser","");
using System; using System.Collections.Generic; using System.Text; using Caplin.StreamLink; using Caplin.StreamLink.Authentication; using Caplin.StreamLink.Authentication.KeyMaster; using System.Threading; using Caplin.StreamLink.Configuration; namespace StreamLinkExamples.Authentication { class StandardKeyMaster : IExceptionHandler { public void StandardKeyMasterExample() { // set up a StreamLink and add a connection listener IStreamLink myStreamLink = new StreamLink(SimpleConfiguration.CreateType2HttpConnection("myliberatorserver", 80)); IConnectionListener connectionListener = new ExampleConnectionListener(); myStreamLink.StreamLinkProvider.AddConnectionListener(connectionListener); // add this class as an ExceptionHandler so that we can see any failures myStreamLink.ExceptionHandler = this; // set up KeyMaster configuration String keyMasterURI = "http://mykeymasterserver.mydomain.com:1234/keymaster-basic/servlet/StandardKeyMaster"; ICredentials keyMasterCredentials = new Credentials("keymasteruser", null); myStreamLink.CredentialsProvider = new StandardKeyMasterCredentialsProvider(keyMasterURI, keyMasterCredentials); // log in myStreamLink.StreamLinkProvider.Connect(); } #region IExceptionHandler Members void IExceptionHandler.HandleException(Exception ex) { string exceptionMessage = ex.InnerException == null ? ex.Message : ex.InnerException.Message; Console.WriteLine(exceptionMessage); } #endregion } class ExampleConnectionListener : IConnectionListener { #region IConnectionListener Members void IConnectionListener.ConnectionStatusUpdated(IConnectionStatusEvent ev) { Console.WriteLine("Connection Status Updated: " + ev.Status); } void IConnectionListener.SourceStatusUpdated(ISourceStatusEvent ev) { Console.WriteLine("Source Status Updated: " + ev.Name + "=" + ev.Status); } void IConnectionListener.ServiceStatusUpdated(IServiceStatusEvent ev) { Console.WriteLine("Service Status Updated: " + ev.Name + "=" + ev.Status); } #endregion } }
Object | ||
KeyMasterCredentialsProvider | ||
StandardKeyMasterCredentialsProvider |