@Override
    public void refresh()
            throws LoginException, GSSException
    {
        // TODO: do we need to call logout() on the LoginContext?
        loginContext = new LoginContext("", null, null, new Configuration()
        {
            @Override
            public AppConfigurationEntry[] getAppConfigurationEntry(String name)
            {
                ImmutableMap.Builder<String, String> options = ImmutableMap.builder();
                options.put("refreshKrb5Config", "true");
                options.put("doNotPrompt", "true");
                options.put("useKeyTab", "true");
                if (getBoolean("trino.client.debugKerberos")) {
                    options.put("debug", "true");
                }
                keytab.ifPresent(file -> options.put("keyTab", file.getAbsolutePath()));
                credentialCache.ifPresent(file -> {
                    options.put("ticketCache", file.getAbsolutePath());
                    options.put("renewTGT", "true");
                });
                if (!keytab.isPresent() || credentialCache.isPresent()) {
                    options.put("useTicketCache", "true");
                }
                principal.ifPresent(value -> options.put("principal", value));
                return new AppConfigurationEntry[] {
                        new AppConfigurationEntry(Krb5LoginModule.class.getName(), REQUIRED, options.buildOrThrow())
                };
            }
        });
        loginContext.login();
    }
@Override
    public void refresh()
            throws LoginException, GSSException
    {
       
        loginContext = new LoginContext("", null, null, new Configuration()
        {
            @Override
            public AppConfigurationEntry[] getAppConfigurationEntry(String name)
            {
                ImmutableMap.Builder<String, String> options = ImmutableMap.builder();
                options.put("refreshKrb5Config", "true");
                options.put("doNotPrompt", "true");
                options.put("useKeyTab", "true");
                if (getBoolean("trino.client.debugKerberos")) {
                    options.put("debug", "true");
                }
                keytab.ifPresent(file -> options.put("keyTab", file.getAbsolutePath()));
                credentialCache.ifPresent(file -> {
                    options.put("ticketCache", file.getAbsolutePath());
                    options.put("renewTGT", "true");
                });
                if (!keytab.isPresent() || credentialCache.isPresent()) {
                    options.put("useTicketCache", "true");
                }
                principal.ifPresent(value -> options.put("principal", value));
                return new AppConfigurationEntry[] {
                        new AppConfigurationEntry(Krb5LoginModule.class.getName(), REQUIRED, options.buildOrThrow())
                };
            }
        });
        loginContext.login();
    }
@override public void refresh() throws loginexception, gssexception { logincontext = new logincontext("", null, null, new configuration() { @override public appconfigurationentry[] getappconfigurationentry(string name) { immutablemap.builder<string, string> options = immutablemap.builder(); options.put("refreshkrb5config", "true"); options.put("donotprompt", "true"); options.put("usekeytab", "true"); if (getboolean("trino.client.debugkerberos")) { options.put("debug", "true"); } keytab.ifpresent(file -> options.put("keytab", file.getabsolutepath())); credentialcache.ifpresent(file -> { options.put("ticketcache", file.getabsolutepath()); options.put("renewtgt", "true"); }); if (!keytab.ispresent() || credentialcache.ispresent()) { options.put("useticketcache", "true"); } principal.ifpresent(value -> options.put("principal", value)); return new appconfigurationentry[] { new appconfigurationentry(krb5loginmodule.class.getname(), required, options.buildorthrow()) }; } }); logincontext.login(); }