Get session from realm and pass it to EnableAutoSessionRenewal() as required in gokrb5 1.2.0
Project: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/commit/edab32cb Tree: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/tree/edab32cb Diff: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/diff/edab32cb Branch: refs/heads/master Commit: edab32cb4ce193327c368c54d752e90c93465449 Parents: 10d28d4 Author: Francis Chuang <francis.chu...@boostport.com> Authored: Wed Oct 18 13:17:05 2017 +1100 Committer: Francis Chuang <francis.chu...@boostport.com> Committed: Wed Oct 18 13:41:21 2017 +1100 ---------------------------------------------------------------------- http_client.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/edab32cb/http_client.go ---------------------------------------------------------------------- diff --git a/http_client.go b/http_client.go index 070986f..6aa75bf 100644 --- a/http_client.go +++ b/http_client.go @@ -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 }