예제 #1
0
 public static void main()
 {
     using (var clientCredentials = GssCredentials.FromPassword("<username>", "<password>"))
         using (var serverCredentials = GssCredentials.FromKeytab("<service>", CredentialUsage.Accept))
         {
             using (var initiator = new GssInitiator(credential: clientCredentials, spn: "<service>"))
                 using (var acceptor = new GssAcceptor(credential: serverCredentials))
                 {
                     var token = initiator.Initiate(null);
                     acceptor.Accept(token);
                 }
         }
 }
예제 #2
0
        public static void main()
        {
            // Generate a token
            var initiator = new GssInitiator(
                credential: GssCredentials.FromPassword("<username>", "<password>"),
                spn: "<service>");

            var token = initiator.Initiate(null);

            // Accept the token
            var acceptor = new GssAcceptor(
                credential: GssCredentials.FromKeytab("<service>", CredentialUsage.Accept));

            acceptor.Accept(token);
        }