/** * Construct with prepared authToken and token format. * * @param authToken The authToken * @param format The token format */ public KrbToken(AuthToken authToken, TokenFormat format) { this(); this.innerToken = authToken; setTokenType(); setTokenFormat(format); try { setTokenValue(getTokenEncoder(format).encodeAsBytes(innerToken)); } catch (KrbException e) { throw new RuntimeException("Failed to encode AuthToken", e); } }
/** * Construct with prepared authToken and token format. * * @param authToken The authToken * @param format The token format */ public KrbToken(AuthToken authToken, TokenFormat format) { this(); this.innerToken = authToken; setTokenType(); setTokenFormat(format); try { setTokenValue(getTokenEncoder(format).encodeAsBytes(innerToken)); } catch (KrbException e) { throw new RuntimeException("Failed to encode AuthToken", e); } }
krbToken.setTokenType(); krbToken.setTokenFormat(TokenFormat.JWT);
krbToken.setTokenType(); krbToken.setTokenFormat(TokenFormat.JWT);
/** * {@inheritDoc} */ /* @Override public void decode(ByteBuffer content) throws IOException { super.decode(content); this.innerToken = getTokenDecoder().decodeFromBytes(getTokenValue()); setTokenType(); }*/ @Override public void decode(Asn1ParseResult parseResult) throws IOException { super.decode(parseResult); if (getTokenValue() != null) { this.innerToken = getTokenDecoder(getTokenFormat()).decodeFromBytes(getTokenValue()); setTokenType(); } }
/** * {@inheritDoc} */ /* @Override public void decode(ByteBuffer content) throws IOException { super.decode(content); this.innerToken = getTokenDecoder().decodeFromBytes(getTokenValue()); setTokenType(); }*/ @Override public void decode(Asn1ParseResult parseResult) throws IOException { super.decode(parseResult); if (getTokenValue() != null) { this.innerToken = getTokenDecoder(getTokenFormat()).decodeFromBytes(getTokenValue()); setTokenType(); } }