Represents the credentials of the user running the current process, for use as an SSPI client.
Inheritance: CurrentCredential
Example #1
0
 public void Init(string service, string host)
 {
     if (!String.IsNullOrEmpty(service))
     {
         //For the server principal: "dse/[email protected]"
         //the expected Uri is: "dse/cassandra1.datastax.com"
         service = service + "/" + host;
     }
     else
     {
         //Use string empty
         service = "";
     }
     //Acquire credentials
     _credentials = new ClientCredential(PackageNames.Kerberos);
     //Initialize security context
     _context = new ClientContext(_credentials, service, ContextRequestAttributes);
 }
 /// <summary>
 /// Initializes a new instance of the ClientContext class. The context is not fully initialized and usable
 /// until the authentication cycle has been completed.
 /// </summary>
 /// <param name="cred">The security credential to authenticate as.</param>
 /// <param name="serverPrinc">The principle name of the server to connect to, or null for any.</param>
 /// <param name="requestedAttribs">Requested attributes that describe the desired properties of the
 /// context once it is established. If a context cannot be established that satisfies the indicated
 /// properties, the context initialization is aborted.</param>
 public ClientContext( ClientCredential cred, string serverPrinc, ContextAttrib requestedAttribs )
     : base( cred )
 {
     this.serverPrinc = serverPrinc;
     this.requestedAttribs = requestedAttribs;
 }