/** * Set token type. */ public void setTokenType() { List<String> audiences = this.innerToken.getAudiences(); if (audiences != null && audiences.size() == 1 && audiences.get(0).startsWith(KrbConstant.TGS_PRINCIPAL)) { isIdToken(true); } else { isAcToken(true); } }
/** * Set token type. */ public void setTokenType() { List<String> audiences = this.innerToken.getAudiences(); if (audiences != null && audiences.size() == 1 && audiences.get(0).startsWith(KrbConstant.TGS_PRINCIPAL)) { isIdToken(true); } else { isAcToken(true); } }
/** * Request a TGT with user token credential and armor cache * @param token The KrbToken * @param armorCache The armor cache * @return TGT * @throws KrbException e */ public TgtTicket requestTgt(KrbToken token, String armorCache) throws KrbException { if (!token.isIdToken()) { throw new IllegalArgumentException("Identity token is expected"); } KOptions requestOptions = new KOptions(); requestOptions.add(TokenOption.USER_ID_TOKEN, token); requestOptions.add(KrbOption.ARMOR_CACHE, armorCache); return requestTgt(requestOptions); }
/** * Request a TGT with user token credential and tgt * @param token The KrbToken * @param tgt The tgt ticket * @return TGT * @throws KrbException e */ public TgtTicket requestTgt(KrbToken token, TgtTicket tgt) throws KrbException { if (!token.isIdToken()) { throw new IllegalArgumentException("Identity token is expected"); } KOptions requestOptions = new KOptions(); requestOptions.add(TokenOption.USER_ID_TOKEN, token); requestOptions.add(KrbOption.TGT, tgt); return requestTgt(requestOptions); }
/** * Request a TGT with user token credential and armor cache * @param token The KrbToken * @param armorCache The armor cache * @return TGT * @throws KrbException e */ public TgtTicket requestTgt(KrbToken token, String armorCache) throws KrbException { if (!token.isIdToken()) { throw new IllegalArgumentException("Identity token is expected"); } KOptions requestOptions = new KOptions(); requestOptions.add(TokenOption.USER_ID_TOKEN, token); requestOptions.add(KrbOption.ARMOR_CACHE, armorCache); return requestTgt(requestOptions); }
/** * Request a TGT with user token credential and tgt * @param token The KrbToken * @param tgt The tgt ticket * @return TGT * @throws KrbException e */ public TgtTicket requestTgt(KrbToken token, TgtTicket tgt) throws KrbException { if (!token.isIdToken()) { throw new IllegalArgumentException("Identity token is expected"); } KOptions requestOptions = new KOptions(); requestOptions.add(TokenOption.USER_ID_TOKEN, token); requestOptions.add(KrbOption.TGT, tgt); return requestTgt(requestOptions); }