当前位置: 首页>>代码示例>>Java>>正文


Java KerberosTicket.getRenewTill方法代码示例

本文整理汇总了Java中javax.security.auth.kerberos.KerberosTicket.getRenewTill方法的典型用法代码示例。如果您正苦于以下问题:Java KerberosTicket.getRenewTill方法的具体用法?Java KerberosTicket.getRenewTill怎么用?Java KerberosTicket.getRenewTill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.security.auth.kerberos.KerberosTicket的用法示例。


在下文中一共展示了KerberosTicket.getRenewTill方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ticketToCreds

import javax.security.auth.kerberos.KerberosTicket; //导入方法依赖的package包/类
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
        throws KrbException, IOException {
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        kerbTicket.getServer().getName(),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:Krb5Util.java

示例2: getInstance

import javax.security.auth.kerberos.KerberosTicket; //导入方法依赖的package包/类
static Krb5InitCredential getInstance(GSSCaller caller, Krb5NameElement name,
                               int initLifetime)
    throws GSSException {

    KerberosTicket tgt = getTgt(caller, name, initLifetime);
    if (tgt == null)
        throw new GSSException(GSSException.NO_CRED, -1,
                               "Failed to find any Kerberos tgt");

    if (name == null) {
        String fullName = tgt.getClient().getName();
        name = Krb5NameElement.getInstance(fullName,
                                   Krb5MechFactory.NT_GSS_KRB5_PRINCIPAL);
    }

    return new Krb5InitCredential(name,
                                  tgt.getEncoded(),
                                  tgt.getClient(),
                                  tgt.getServer(),
                                  tgt.getSessionKey().getEncoded(),
                                  tgt.getSessionKeyType(),
                                  tgt.getFlags(),
                                  tgt.getAuthTime(),
                                  tgt.getStartTime(),
                                  tgt.getEndTime(),
                                  tgt.getRenewTill(),
                                  tgt.getClientAddresses());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:Krb5InitCredential.java

示例3: login

import javax.security.auth.kerberos.KerberosTicket; //导入方法依赖的package包/类
/**
 * Method called once initially to login. It also starts the thread used
 * to periodically re-login to the Kerberos Authentication Server.
 * @return
 * @throws LoginException if login fails
 */
@Override
public LoginContext login() throws LoginException {
    super.login();
    isKrbTicket = !loginContext.getSubject().getPrivateCredentials(KerberosTicket.class).isEmpty();
    if (!isKrbTicket) {
        log.info("It is not a Kerberos ticket");
        t = null;
        // if no TGT, do not bother with ticket management.
        return loginContext;
    }
    log.info("It is a Kerberos ticket");
    AppConfigurationEntry[] entries = Configuration.getConfiguration().getAppConfigurationEntry(loginContextName);
    if (entries.length == 0) {
        isUsingTicketCache = false;
        principal = null;
    } else {
        // there will only be a single entry
        AppConfigurationEntry entry = entries[0];
        if (entry.getOptions().get("useTicketCache") != null) {
            String val = (String) entry.getOptions().get("useTicketCache");
            isUsingTicketCache = val.equals("true");
        } else
            isUsingTicketCache = false;
        if (entry.getOptions().get("principal") != null)
            principal = (String) entry.getOptions().get("principal");
        else
            principal = null;
    }
    KerberosTicket tgt = getTGT();
    if (tgt != null) {
        if (isUsingTicketCache && tgt.getRenewTill() != null && tgt.getRenewTill().getTime() < tgt.getEndTime().getTime()) {
            log.warn("The TGT cannot be renewed beyond the next expiry date: {}. This process will not be able to authenticate new clients after that " +
                    "time. Ask your system administrator to either increase the 'renew until' time by doing : 'modprinc -maxrenewlife {} ' within " +
                    "kadmin, or instead, to generate a keytab for {}. Because the TGT's expiry cannot be further extended by refreshing, exiting " +
                    "refresh thread now.", new Date(tgt.getEndTime().getTime()), principal, principal);
        } else {
            spawnReloginThread();
        }
    } else {
        log.warn("No tgt found for principal {}. Hence not spawning auto relogin thread.", principal);
    }
    return loginContext;
}
 
开发者ID:hortonworks,项目名称:registry,代码行数:50,代码来源:KerberosLogin.java

示例4: ticketToCreds

import javax.security.auth.kerberos.KerberosTicket; //导入方法依赖的package包/类
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
    throws KrbException, IOException {
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        kerbTicket.getServer().getName(),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:16,代码来源:Krb5Util.java


注:本文中的javax.security.auth.kerberos.KerberosTicket.getRenewTill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。