Package org.apache.sandesha2.security

Examples of org.apache.sandesha2.security.SecurityToken


      // If the inbound CreateSequence includes a SecurityTokenReference then
      // ask the security manager to resolve that to a token for us. We also
      // check that the Create was secured using the token.
      SecurityManager secManager = SandeshaUtil.getSecurityManager(context);
      OMElement theSTR = createSeqPart.getSecurityTokenReference();
      SecurityToken token = null;
      if(theSTR != null) {
        MessageContext msgcontext = createSeqRMMsg.getMessageContext();
        token = secManager.getSecurityToken(theSTR, msgcontext);
       
        // The create must be the body part of this message, so we check the
View Full Code Here


    // Check that the sender of this TerminateSequence holds the correct token
    RMDBean rmdBean = SandeshaUtil.getRMDBeanFromSequenceId(storageManager, sequenceId);
    if(rmdBean != null && rmdBean.getSecurityTokenData() != null) {
      SecurityManager secManager = SandeshaUtil.getSecurityManager(context);
      OMElement body = terminateSeqRMMsg.getSOAPEnvelope().getBody();
      SecurityToken token = secManager.recoverSecurityToken(rmdBean.getSecurityTokenData());
      secManager.checkProofOfPossession(token, body, terminateSeqRMMsg.getMessageContext());
    }

    if (FaultManager.checkForUnknownSequence(terminateSeqRMMsg, sequenceId, storageManager, false)) {
      if (log.isDebugEnabled())
View Full Code Here

    // Check that the sender of this TerminateSequence holds the correct token
    if(rmsBean != null && rmsBean.getSecurityTokenData() != null) {
      SecurityManager secManager = SandeshaUtil.getSecurityManager(context);
      OMElement body = terminateResRMMsg.getSOAPEnvelope().getBody();
      SecurityToken token = secManager.recoverSecurityToken(rmsBean.getSecurityTokenData());
      secManager.checkProofOfPossession(token, body, msgContext);
    }

    msgContext.setProperty(Sandesha2Constants.MessageContextProperties.INTERNAL_SEQUENCE_ID,rmsBean.getInternalSequenceID());
View Full Code Here

      tokenData = bean.getSecurityTokenData();
    }
    if(tokenData != null) {
      if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled()) log.debug("debug:" + tokenData);
      SecurityManager secManager = SandeshaUtil.getSecurityManager(context.getConfigurationContext());
      SecurityToken token = secManager.recoverSecurityToken(tokenData);
      secManager.checkProofOfPossession(token, elementToCheck, context); //this will exception if there is no proof
    }
   
    if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled())
      log.debug("Exit: SandeshaUtil::assertProofOfPossession");
View Full Code Here

            if (principal instanceof WSDerivedKeyTokenPrincipal) {
              //Get the id of the SCT that was used to create the DKT
              String baseTokenId = ((WSDerivedKeyTokenPrincipal) principal)
                  .getBasetokenId();
              //Get the token that matches the id
              SecurityToken recoveredToken = this
                  .recoverSecurityToken(baseTokenId);
              if (recoveredToken != null) {
                Token rahasToken = ((RampartSecurityToken) recoveredToken)
                    .getToken();
                //check whether the SCT used in the message is
View Full Code Here

      // If the inbound CreateSequence includes a SecurityTokenReference then
      // ask the security manager to resolve that to a token for us. We also
      // check that the Create was secured using the token.
      SecurityManager secManager = SandeshaUtil.getSecurityManager(context);
      OMElement theSTR = createSeqPart.getSecurityTokenReference();
      SecurityToken token = null;
      if(theSTR != null) {
        MessageContext msgcontext = createSeqRMMsg.getMessageContext();
        token = secManager.getSecurityToken(theSTR, msgcontext);
       
        // The create must be the body part of this message, so we check the
View Full Code Here

      MessageContext clonedMessage = SandeshaUtil.cloneMessageContext(createSeqMsg);
      String clonedMsgStoreKey = SandeshaUtil.getUUID();
      storageManager.storeMessageContext(clonedMsgStoreKey, clonedMessage);
      rmsBean.setReferenceMessageStoreKey(clonedMsgStoreKey);
     
      SecurityToken token = (SecurityToken) createSeqRMMessage.getProperty(Sandesha2Constants.MessageContextProperties.SECURITY_TOKEN);
      if(token != null) {
        SecurityManager secManager = SandeshaUtil.getSecurityManager(configCtx);
        rmsBean.setSecurityTokenData(secManager.getTokenRecoveryData(token));
      }
View Full Code Here

      //some initial setup
      ConfigurationContext configurationContext = rmMsgCtx.getConfigurationContext();
      StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext, configurationContext.getAxisConfiguration());
      SecurityManager secManager = SandeshaUtil.getSecurityManager(configurationContext);
      SecurityToken token = secManager.getSecurityToken(rmMsgCtx.getMessageContext());

      //we want to find valid sender beans
      List<RMSequenceBean> possibleBeans = new ArrayList<RMSequenceBean>();
      int possibleBeanIndex = -10;
      SenderBean findSenderBean = new SenderBean();
View Full Code Here

      tokenData = bean.getSecurityTokenData();
    }
    if(tokenData != null) {
      if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled()) log.debug("debug:" + tokenData);
      SecurityManager secManager = SandeshaUtil.getSecurityManager(context.getConfigurationContext());
      SecurityToken token = secManager.recoverSecurityToken(tokenData);
      secManager.checkProofOfPossession(token, elementToCheck, context); //this will exception if there is no proof
    }
   
    if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled())
      log.debug("Exit: SandeshaUtil::assertProofOfPossession");
View Full Code Here

    // Find the token that should be used to secure this new sequence. If there is a token, then we
    // save it in the properties so that the caller can store the token within the create sequence
    // bean.
    SecurityManager secMgr = SandeshaUtil.getSecurityManager(context);
    SecurityToken token = secMgr.getSecurityToken(applicationMsgContext);
    if(token != null) {
      OMElement str = secMgr.createSecurityTokenReference(token, createSeqmsgContext);
      createSequencePart.setSecurityTokenReference(str);
      createSeqRMMsg.setProperty(Sandesha2Constants.MessageContextProperties.SECURITY_TOKEN, token);
     
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.security.SecurityToken

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.