Exemplo n.º 1
0
 public void LsaConnectUntrusted()
 {
     using (var interop = LsaInterop.Connect())
     {
         Assert.IsNotNull(interop);
     }
 }
Exemplo n.º 2
0
        public void LsaImportCredential()
        {
            var cred = CreateKrbCredential();

            using (var interop = LsaInterop.Connect())
            {
                Assert.IsNotNull(interop);

                interop.ImportCredential(cred);
            }
        }
Exemplo n.º 3
0
        public void LsaImportSspiIsc()
        {
            var cred = CreateKrbCredential();

            using (var interop = LsaInterop.Connect())
            {
                Assert.IsNotNull(interop);

                interop.ImportCredential(cred);

                RetrieveAndVerifyTicket();
            }
        }
Exemplo n.º 4
0
        public async Task LsaLogonUserImportUseCache()
        {
            var cred   = CreateKrbCredential();
            var config = Krb5Config.Default();

            using (var interop = LsaInterop.Connect())
            {
                Assert.IsNotNull(interop);

                interop.LogonUser();

                interop.ImportCredential(cred);

                using (var client = new KerberosClient(config)
                {
                    Cache = new LsaCredentialCache(config, interop)
                })
                {
                    var ticket = await client.GetServiceTicket(RequestedSpn);

                    Assert.IsNotNull(ticket);
                }
            }
        }
Exemplo n.º 5
0
 public LsaCredentialCache(Krb5Config config, LsaInterop lsa = null, ILoggerFactory logger = null)
     : base(config, logger)
 {
     this.lsa = lsa ?? LsaInterop.Connect();
 }