tgsRequest.setRequestOptions(requestOptions); SgtTicket sgtTicket = doRequestSgt(tgsRequest); sgtTicket.setClientPrincipal(clientPrincipalName); tgsRequest = new TgsRequestWithTgt(context, sgtTicket); sgtTicket.setClientPrincipal(clientPrincipalName);
tgsRequest.setRequestOptions(requestOptions); SgtTicket sgtTicket = doRequestSgt(tgsRequest); sgtTicket.setClientPrincipal(clientPrincipalName); tgsRequest = new TgsRequestWithTgt(context, sgtTicket); sgtTicket.setClientPrincipal(clientPrincipalName);
/** * Request a service ticket * @param ccFile The credential cache file * @param servicePrincipal The service principal * @return service ticket * @throws KrbException e */ public SgtTicket requestSgt(File ccFile, String servicePrincipal) throws KrbException { Credential credential = getCredentialFromFile(ccFile); TgtTicket tgt = getTgtTicketFromCredential(credential); KOptions requestOptions = new KOptions(); // Renew ticket if argument named servicePrincipal is null if (servicePrincipal == null) { requestOptions.add(KrbKdcOption.RENEW); servicePrincipal = credential.getServicePrincipal().getName(); } requestOptions.add(KrbOption.USE_TGT, tgt); requestOptions.add(KrbOption.SERVER_PRINCIPAL, servicePrincipal); SgtTicket sgtTicket = innerClient.requestSgt(requestOptions); sgtTicket.setClientPrincipal(tgt.getClientPrincipal()); return sgtTicket; }
/** * Request a service ticket * @param ccFile The credential cache file * @param servicePrincipal The service principal * @return service ticket * @throws KrbException e */ public SgtTicket requestSgt(File ccFile, String servicePrincipal) throws KrbException { Credential credential = getCredentialFromFile(ccFile); TgtTicket tgt = getTgtTicketFromCredential(credential); KOptions requestOptions = new KOptions(); // Renew ticket if argument named servicePrincipal is null if (servicePrincipal == null) { requestOptions.add(KrbKdcOption.RENEW); servicePrincipal = credential.getServicePrincipal().getName(); } requestOptions.add(KrbOption.USE_TGT, tgt); requestOptions.add(KrbOption.SERVER_PRINCIPAL, servicePrincipal); SgtTicket sgtTicket = innerClient.requestSgt(requestOptions); sgtTicket.setClientPrincipal(tgt.getClientPrincipal()); return sgtTicket; }