Get session from realm and pass it to EnableAutoSessionRenewal() as required in gokrb...
authorFrancis Chuang <francis.chuang@boostport.com>
Wed, 18 Oct 2017 02:17:05 +0000 (13:17 +1100)
committerFrancis Chuang <francis.chuang@boostport.com>
Wed, 18 Oct 2017 02:41:21 +0000 (13:41 +1100)
http_client.go

index 070986f..6aa75bf 100644 (file)
@@ -119,7 +119,13 @@ func NewHTTPClient(host string, authenticationConf httpClientAuthConfig) (*httpC
                                return nil, fmt.Errorf("error performing kerberos login with keytab: %s", err)
                        }
 
-                       kc.EnableAutoSessionRenewal()
+                       session, err := kc.GetSessionFromRealm(authenticationConf.principal.realm)
+
+                       if err != nil {
+                               return nil, fmt.Errorf("error getting session from realm name: %s", err)
+                       }
+
+                       kc.EnableAutoSessionRenewal(session)
 
                        c.kerberosClient = kc
                }