public SgtTicket requestSgt(KrbToken token, String serverPrincipal, TgtTicket tgt) throws KrbException { if (!token.isAcToken()) { throw new IllegalArgumentException("Access token is expected"); } KOptions requestOptions = new KOptions(); requestOptions.add(TokenOption.USER_AC_TOKEN, token); requestOptions.add(KrbOption.TGT, tgt); requestOptions.add(KrbOption.SERVER_PRINCIPAL, serverPrincipal); return requestSgt(requestOptions); } }
public SgtTicket requestSgt(KrbToken token, String serverPrincipal, TgtTicket tgt) throws KrbException { if (!token.isAcToken()) { throw new IllegalArgumentException("Access token is expected"); } KOptions requestOptions = new KOptions(); requestOptions.add(TokenOption.USER_AC_TOKEN, token); requestOptions.add(KrbOption.TGT, tgt); requestOptions.add(KrbOption.SERVER_PRINCIPAL, serverPrincipal); return requestSgt(requestOptions); } }
public static SgtTicket applySgtCredential(TgtTicket tgt, KrbToken krbToken, String server) throws GSSException { KrbTokenClient client = getKrbTokenClient(); try { client.init(); return client.requestSgt(krbToken, server, tgt); } catch (KrbException e) { throw new GSSException(GSSException.FAILURE, -1, e.getMessage()); } }
/** * Request a service ticket using an Access Token. * @param token The KrbToken * @param serverPrincipal The server principal * @param armorCache The armor cache * @return service ticket * @throws KrbException e */ public SgtTicket requestSgt( KrbToken token, String serverPrincipal, String armorCache) throws KrbException { if (!token.isAcToken()) { throw new IllegalArgumentException("Access token is expected"); } KOptions requestOptions = new KOptions(); requestOptions.add(TokenOption.USER_AC_TOKEN, token); requestOptions.add(KrbOption.ARMOR_CACHE, armorCache); requestOptions.add(KrbOption.SERVER_PRINCIPAL, serverPrincipal); return requestSgt(requestOptions); }
/** * Request a service ticket using an Access Token. * @param token The KrbToken * @param serverPrincipal The server principal * @param armorCache The armor cache * @return service ticket * @throws KrbException e */ public SgtTicket requestSgt( KrbToken token, String serverPrincipal, String armorCache) throws KrbException { if (!token.isAcToken()) { throw new IllegalArgumentException("Access token is expected"); } KOptions requestOptions = new KOptions(); requestOptions.add(TokenOption.USER_AC_TOKEN, token); requestOptions.add(KrbOption.ARMOR_CACHE, armorCache); requestOptions.add(KrbOption.SERVER_PRINCIPAL, serverPrincipal); return requestSgt(requestOptions); }