Package org.apache.tuscany.sca.policy.authentication.token

Examples of org.apache.tuscany.sca.policy.authentication.token.TokenPrincipal


           
            // call out here to some 3rd party system to do whatever you
            // need to turn header credentials into an authenticated principal 
           
            Subject subject = SecurityUtil.getSubject(msg);
            Principal principal = new TokenPrincipal(header.getHeaderString());
            subject.getPrincipals().add(principal);           
        }
   
        return getNext().invoke(msg);
    }
View Full Code Here


          javax.jms.Message jmsMsg = msg.getBody();
         
          if ( policy.getTokenName() != null){
     
              Subject subject = SecurityUtil.getSubject(msg);
              TokenPrincipal principal = SecurityUtil.getPrincipal(subject, TokenPrincipal.class);
             
              if (principal == null){
                // should call out here to some 3rd party system to get credentials
                // and correct token. Here we are just putting in the token name
                  principal = new TokenPrincipal("DummyTokenID");
                  subject.getPrincipals().add(principal);
              }
             
              jmsMsg.setStringProperty(policy.getTokenName().toString(), principal.getName());
          }
         
          return getNext().invoke(msg);
         
      } catch (JMSException e) {
View Full Code Here

          javax.jms.Message jmsMsg = context.getJmsMsg();
         
          String token = jmsMsg.getStringProperty(policy.getTokenName().toString());
         
          Subject subject = SecurityUtil.getSubject(msg);
          TokenPrincipal principal = SecurityUtil.getPrincipal(subject, TokenPrincipal.class);
         
          if (principal == null){
              principal = new TokenPrincipal(token);
              subject.getPrincipals().add(principal);
          }
         
          System.out.println("JMS service received token: " + principal.getName());
         
          // call out here to some 3rd party system to do whatever you
          // need to authenticate the principal
     
          return getNext().invoke(msg);
View Full Code Here

           
            // call out here to some 3rd party system to do whatever you
            // need to turn header credentials into an authenticated principal 
           
            Subject subject = SecurityUtil.getSubject(msg);
            Principal principal = new TokenPrincipal(header.getHeaderString());
            subject.getPrincipals().add(principal);           
        }
   
        return getNext().invoke(msg);
    }
View Full Code Here

          javax.jms.Message jmsMsg = msg.getBody();
         
          if ( policy.getTokenName() != null){
     
              Subject subject = SecurityUtil.getSubject(msg);
              TokenPrincipal principal = SecurityUtil.getPrincipal(subject, TokenPrincipal.class);
             
              if (principal == null){
                // should call out here to some 3rd party system to get credentials
                // and correct token. Here we are just putting in the token name
                  principal = new TokenPrincipal("DummyTokenID");
                  subject.getPrincipals().add(principal);
              }
             
              jmsMsg.setStringProperty(policy.getTokenName().toString(), principal.getName());
          }
         
          return getNext().invoke(msg);
         
      } catch (JMSException e) {
View Full Code Here

          javax.jms.Message jmsMsg = context.getJmsMsg();
         
          String token = jmsMsg.getStringProperty(policy.getTokenName().toString());
         
          Subject subject = SecurityUtil.getSubject(msg);
          TokenPrincipal principal = SecurityUtil.getPrincipal(subject, TokenPrincipal.class);
         
          if (principal == null){
              principal = new TokenPrincipal(token);
              subject.getPrincipals().add(principal);
          }
         
          System.out.println("JMS service received token: " + principal.getName());
         
          // call out here to some 3rd party system to do whatever you
          // need to authenticate the principal
     
          return getNext().invoke(msg);
View Full Code Here

           
            // call out here to some 3rd party system to do whatever you
            // need to turn header credentials into an authenticated principal 
           
            Subject subject = SecurityUtil.getSubject(msg);
            Principal principal = new TokenPrincipal(header.getHeaderString());
            subject.getPrincipals().add(principal);           
        }
   
        return getNext().invoke(msg);
    }
View Full Code Here

           
            // call out here to some 3rd party system to do whatever you
            // need to turn header credentials into an authenticated principal 
           
            Subject subject = SecurityUtil.getSubject(msg);
            Principal principal = new TokenPrincipal(header.getHeaderString());
            subject.getPrincipals().add(principal);           
        }
   
        return getNext().invoke(msg);
    }
View Full Code Here

          javax.jms.Message jmsMsg = msg.getBody();
         
          if ( policy.getTokenName() != null){
     
              Subject subject = SecurityUtil.getSubject(msg);
              TokenPrincipal principal = SecurityUtil.getPrincipal(subject, TokenPrincipal.class);
             
              if (principal == null){
                // should call out here to some 3rd party system to get credentials
                // and correct token. Here we are just putting in the token name
                  principal = new TokenPrincipal("DummyTokenID");
                  subject.getPrincipals().add(principal);
              }
             
              jmsMsg.setStringProperty(policy.getTokenName().toString(), principal.getName());
          }
         
          return getNext().invoke(msg);
         
      } catch (JMSException e) {
View Full Code Here

          javax.jms.Message jmsMsg = context.getJmsMsg();
         
          String token = jmsMsg.getStringProperty(policy.getTokenName().toString());
         
          Subject subject = SecurityUtil.getSubject(msg);
          TokenPrincipal principal = SecurityUtil.getPrincipal(subject, TokenPrincipal.class);
         
          if (principal == null){
              principal = new TokenPrincipal(token);
              subject.getPrincipals().add(principal);
          }
         
          System.out.println("JMS service received token: " + principal.getName());
         
          // call out here to some 3rd party system to do whatever you
          // need to authenticate the principal
     
          return getNext().invoke(msg);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.policy.authentication.token.TokenPrincipal

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.