/** * @return The Kerberos message type field */ public KrbMessageType getMsgType() { Integer value = getFieldAsInteger(KrbMessageField.MSG_TYPE); return KrbMessageType.fromValue(value); }
/** * Sets the PVNO field * @param pvno The PVNO to set */ protected void setPvno(int pvno) { setFieldAsInt(KrbMessageField.PVNO, pvno); }
/** * Creates a new instance of a KrbMessage. It's not possible to invoque this * constructor directly. * * @param msgType The Kerberos messag etype * @param fieldInfos The fields to use */ protected KrbMessage(KrbMessageType msgType, Asn1FieldInfo[] fieldInfos) { super(msgType.getValue(), fieldInfos); setPvno(pvno); setMsgType(msgType); }
public TgtTicket handleResponse(JSONObject json, String passPhrase) throws HasException { KrbMessage kdcRep = getKrbMessage(json); KrbMessageType messageType = kdcRep.getMsgType(); if (messageType == KrbMessageType.AS_REP) { return processResponse((KdcRep) kdcRep, passPhrase); } else if (messageType == KrbMessageType.KRB_ERROR) { KrbError error = (KrbError) kdcRep; LOG.error("HAS server response with message: " + error.getErrorCode().getMessage()); throw new HasException(error.getEtext()); } return null; }
KrbMessageType messageType = krbRequest.getMsgType(); if (messageType == KrbMessageType.TGS_REQ || messageType == KrbMessageType.AS_REQ) { int bodyLen = krbResponse.encodingLength(); ByteBuffer responseMessage; if (isTcp) {
public static KrbMessage decodeMessage(ByteBuffer buffer) throws IOException { Asn1ParseResult parsingResult = Asn1.parse(buffer); Tag tag = parsingResult.tag(); KrbMessage msg; KrbMessageType msgType = KrbMessageType.fromValue(tag.tagNo()); if (msgType == KrbMessageType.TGS_REQ) { msg = new TgsReq(); } else if (msgType == KrbMessageType.AS_REP) { msg = new AsRep(); } else if (msgType == KrbMessageType.AS_REQ) { msg = new AsReq(); } else if (msgType == KrbMessageType.TGS_REP) { msg = new TgsRep(); } else if (msgType == KrbMessageType.AP_REQ) { msg = new ApReq(); } else if (msgType == KrbMessageType.AP_REP) { msg = new ApReq(); } else if (msgType == KrbMessageType.KRB_ERROR) { msg = new KrbError(); } else { throw new IOException("To be supported krb message type with tag: " + tag); } msg.decode(parsingResult); return msg; }
m.put("type", tokenPlugin.getLoginType()); m.put("success", "true"); m.put("krbMessage", base64.encodeToString(asRep.encode())); } catch (IOException e) { errMessage = "Failed to encode KrbMessage. " + e.getMessage();
public TgtTicket handleResponse(JSONObject json, String passPhrase) throws HasException { KrbMessage kdcRep = getKrbMessage(json); KrbMessageType messageType = kdcRep.getMsgType(); if (messageType == KrbMessageType.AS_REP) { return processResponse((KdcRep) kdcRep, passPhrase); } else if (messageType == KrbMessageType.KRB_ERROR) { KrbError error = (KrbError) kdcRep; LOG.error("HAS server response with message: " + error.getErrorCode().getMessage()); throw new HasException(error.getEtext()); } return null; }
KrbMessageType messageType = krbRequest.getMsgType(); if (messageType == KrbMessageType.TGS_REQ || messageType == KrbMessageType.AS_REQ) { int bodyLen = krbResponse.encodingLength(); ByteBuffer responseMessage; if (isTcp) {
public static KrbMessage decodeMessage(ByteBuffer buffer) throws IOException { Asn1ParseResult parsingResult = Asn1.parse(buffer); Tag tag = parsingResult.tag(); KrbMessage msg; KrbMessageType msgType = KrbMessageType.fromValue(tag.tagNo()); if (msgType == KrbMessageType.TGS_REQ) { msg = new TgsReq(); } else if (msgType == KrbMessageType.AS_REP) { msg = new AsRep(); } else if (msgType == KrbMessageType.AS_REQ) { msg = new AsReq(); } else if (msgType == KrbMessageType.TGS_REP) { msg = new TgsRep(); } else if (msgType == KrbMessageType.AP_REQ) { msg = new ApReq(); } else if (msgType == KrbMessageType.AP_REP) { msg = new ApReq(); } else if (msgType == KrbMessageType.KRB_ERROR) { msg = new KrbError(); } else { throw new IOException("To be supported krb message type with tag: " + tag); } msg.decode(parsingResult); return msg; }
m.put("type", tokenPlugin.getLoginType()); m.put("success", "true"); m.put("krbMessage", base64.encodeToString(asRep.encode())); } catch (IOException e) { errMessage = "Failed to encode KrbMessage. " + e.getMessage();
KrbMessageType messageType = kdcRep.getMsgType(); if (messageType == KrbMessageType.AS_REP) {
/** * Creates a new instance of a KrbMessage. It's not possible to invoque this * constructor directly. * * @param msgType The Kerberos messag etype * @param fieldInfos The fields to use */ protected KrbMessage(KrbMessageType msgType, Asn1FieldInfo[] fieldInfos) { super(msgType.getValue(), fieldInfos); setPvno(pvno); setMsgType(msgType); }
/** * Sets the PVNO field * @param pvno The PVNO to set */ protected void setPvno(int pvno) { setFieldAsInt(KrbMessageField.PVNO, pvno); }
/** * @return The Kerberos message type field */ public KrbMessageType getMsgType() { Integer value = getFieldAsInteger(KrbMessageField.MSG_TYPE); return KrbMessageType.fromValue(value); }
KrbMessageType messageType = kdcRep.getMsgType(); if (messageType == KrbMessageType.AS_REP) {
/** * Sets the Kerberos Message Type field * @param msgType The Kerberos Message Type to set */ public void setMsgType(KrbMessageType msgType) { setFieldAsInt(KrbMessageField.MSG_TYPE, msgType.getValue()); } }
/** * Sets the Kerberos Message Type field * @param msgType The Kerberos Message Type to set */ public void setMsgType(KrbMessageType msgType) { setFieldAsInt(KrbMessageField.MSG_TYPE, msgType.getValue()); } }