@Override public int hashCode() { int result = 17; String identifier = getIdentifier(); if (identifier != null) { result = 31 * result + identifier.hashCode(); } return result; }
@Override public boolean equals(Object object) { if (!(object instanceof SecurityContextToken)) { return false; } SecurityContextToken securityToken = (SecurityContextToken)object; if (!compare(getIdentifier(), securityToken.getIdentifier())) { return false; } return true; }
(SecurityContextToken) engineResult.get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN); if (referenceURI.equals(sct.getIdentifier())) { return sct.getElement();
(SecurityContextToken) engineResult.get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN); if (referenceURI.equals(sct.getIdentifier())) { return sct.getElement();
private SecurityToken findCancelOrRenewToken(Exchange exchange, Element el) throws WSSecurityException { Element childElement = DOMUtils.getFirstElement(el); String uri = ""; if ("SecurityContextToken".equals(childElement.getLocalName())) { SecurityContextToken sct = new SecurityContextToken(childElement); uri = sct.getIdentifier(); } else { SecurityTokenReference ref = new SecurityTokenReference(childElement, new BSPEnforcer()); uri = ref.getReference().getURI(); } TokenStore store = (TokenStore)exchange.getEndpoint().getEndpointInfo() .getProperty(TokenStore.class.getName()); return store.getToken(uri); }
private SecurityToken findCancelOrRenewToken(Exchange exchange, Element el) throws WSSecurityException { Element childElement = DOMUtils.getFirstElement(el); String uri = ""; if ("SecurityContextToken".equals(childElement.getLocalName())) { SecurityContextToken sct = new SecurityContextToken(childElement); uri = sct.getIdentifier(); } else { SecurityTokenReference ref = new SecurityTokenReference(childElement, new BSPEnforcer()); uri = ref.getReference().getURI(); } TokenStore store = (TokenStore)exchange.getEndpoint().getEndpointInfo() .getProperty(TokenStore.class.getName()); return store.getToken(uri); }
public void prepare(Crypto crypto) throws WSSecurityException { if (sct == null) { if (identifier != null) { sct = new SecurityContextToken(wscVersion, doc, identifier); } else { sct = new SecurityContextToken(wscVersion, doc); identifier = sct.getIdentifier(); } } // The wsu:Id of the wsc:SecurityContextToken if (sctId == null) { sctId = getWsConfig().getIdAllocator().createId("sctId-", sct); } sct.setID(sctId); }
Element validateTargetElement = (Element)validateTarget.getToken(); SecurityContextToken sct = new SecurityContextToken(validateTargetElement); String identifier = sct.getIdentifier(); SecurityToken token = tokenParameters.getTokenStore().getToken(identifier); if (token == null) {
Element validateTargetElement = (Element)validateTarget.getToken(); SecurityContextToken sct = new SecurityContextToken(validateTargetElement); String identifier = sct.getIdentifier(); SecurityToken token = tokenParameters.getTokenStore().getToken(identifier); if (token == null) {
Element cancelTargetElement = (Element)cancelTarget.getToken(); SecurityContextToken sct = new SecurityContextToken(cancelTargetElement); String identifier = sct.getIdentifier(); SecurityToken token = tokenParameters.getTokenStore().getToken(identifier); if (token == null) {
Element cancelTargetElement = (Element)cancelTarget.getToken(); SecurityContextToken sct = new SecurityContextToken(cancelTargetElement); String identifier = sct.getIdentifier(); SecurityToken token = tokenParameters.getTokenStore().getToken(identifier); if (token == null) {
SecurityContextToken tok = (SecurityContextToken)wser.get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN); message.getExchange().put(SecurityConstants.TOKEN_ID, tok.getIdentifier()); SecurityToken token = TokenStoreUtils.getTokenStore(message).getToken(tok.getIdentifier()); if (token == null || token.isExpired()) { byte[] secret = (byte[])wser.get(WSSecurityEngineResult.TAG_SECRET); if (secret != null) { token = new SecurityToken(tok.getIdentifier()); token.setToken(tok.getElement()); token.setSecret(secret);
SecurityContextToken tok = (SecurityContextToken)wser.get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN); message.getExchange().put(SecurityConstants.TOKEN_ID, tok.getIdentifier()); SecurityToken token = TokenStoreUtils.getTokenStore(message).getToken(tok.getIdentifier()); if (token == null || token.isExpired()) { byte[] secret = (byte[])wser.get(WSSecurityEngineResult.TAG_SECRET); if (secret != null) { token = new SecurityToken(tok.getIdentifier()); token.setToken(tok.getElement()); token.setSecret(secret);
secret = getSecret(data.getCallbackHandler(), sct.getIdentifier()); } catch (WSSecurityException ex) { secret = getSecret(data.getCallbackHandler(), id);
Instant expires = created.plusSeconds(ttl / 1000L); SecurityToken token = new SecurityToken(sct.getIdentifier(), created, expires); token.setToken(sct.getElement()); token.setTokenType(sct.getTokenType()); writeSecurityTokenReference(writer, sct.getIdentifier(), sct.getInstance(), tokenType) ); writer.writeEndElement();
Instant expires = created.plusSeconds(ttl / 1000L); SecurityToken token = new SecurityToken(sct.getIdentifier(), created, expires); token.setToken(sct.getElement()); token.setTokenType(sct.getTokenType()); writeSecurityTokenReference(writer, sct.getIdentifier(), sct.getInstance(), tokenType) ); writer.writeEndElement();
created.plusSeconds(WSS4JUtils.getSecurityTokenLifetime(exchange.getOutMessage()) / 1000L); SecurityToken token = new SecurityToken(sct.getIdentifier(), created, expires); token.setToken(sct.getElement()); token.setTokenType(sct.getTokenType()); writeSecurityTokenReference(writer, sct.getIdentifier(), tokenType) ); writer.writeEndElement();
response.setTokenId(sct.getIdentifier()); if (returnEntropy) { response.setEntropy(keyHandler.getEntropyBytes()); new SecurityToken(sct.getIdentifier(), created, expires); token.setSecret(keyHandler.getSecret()); token.setPrincipal(tokenParameters.getPrincipal()); unAttachedReference.setIdentifier(sct.getIdentifier()); unAttachedReference.setUseDirectReference(true); unAttachedReference.setWsseValueType(tokenRequirements.getTokenType());
created.plusSeconds(WSS4JUtils.getSecurityTokenLifetime(exchange.getOutMessage()) / 1000L); SecurityToken token = new SecurityToken(sct.getIdentifier(), created, expires); token.setToken(sct.getElement()); token.setTokenType(sct.getTokenType()); writeSecurityTokenReference(writer, sct.getIdentifier(), tokenType) ); writer.writeEndElement();
WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN ); parserResult.setPrincipal(new CustomTokenPrincipal(sct.getIdentifier())); } else if (action != null && WSConstants.DKT == action.intValue()) { DerivedKeyToken dkt =