Package org.jboss.soa.esb.services.security.principals

Examples of org.jboss.soa.esb.services.security.principals.User


    }

    private SecurityContext getSecurityContext()
    {
        Subject subject = new Subject();
        subject.getPrincipals().add(new User("Mr.Poon"));
        return new SecurityContext(subject, 5000l);
    }
View Full Code Here


        return this;
      }

      public Builder username( final String username )
      {
        principal = new User( username );
        return this;
      }
View Full Code Here

  {
    AuthenticationRequest authRequest = null;
    String username = (String) request.get(USERNAME_KEY);
    if ( username != null )
    {
      User user = new User((String)username);
      Set<Object> credentials = new HashSet<Object>();
     
      String passwd = (String) request.get(PASSWORD_KEY);
      if ( passwd != null )
      {
View Full Code Here

        if ( soap == null )
        {
            return null;
        }
       
        User user = null;
        Set<Object> credentials = new HashSet<Object>();
       
        try
        {
            final SOAPHeaderElement securityHeader = SOAPExtractorUtil.extractSecurityHeader( soap.getSOAPPart().getEnvelope() );
View Full Code Here

    {
        if (soap == null || !soap.startsWith("<"))
            return null;

        XMLEventReader xmlReader = null;
        User user = null;
        Set<Object> credentials = new HashSet<Object>();
        try
        {
            xmlReader = XML_INPUT_FACTORY.createXMLEventReader(new StringReader(soap));

            while (xmlReader.hasNext())
            {
                XMLEvent xmlEvent = xmlReader.nextEvent();
                if (isStartOfHeader(xmlEvent))
                {
                    while (xmlReader.hasNext())
                    {
                        xmlEvent = xmlReader.nextEvent();
                    if (isStartOfUsernameToken(xmlEvent))
                    {
                        while (xmlReader.hasNext())
                        {
                            xmlEvent = xmlReader.nextEvent();
                            if (isStartOfUsername(xmlEvent))
                            {
                                XMLEvent username = xmlReader.nextEvent();
                                if (username.isCharacters())
                                {
                                    // username is a required element.
                                    user = new User(((Characters) username).getData());
                                }
                            }
                         
                            if (isStartOfPassword(xmlEvent))
                            {
View Full Code Here

    if ( soap == null )
    {
      return null;
    }
   
    User user = null;
    Set<Object> credentials = new HashSet<Object>();
   
    try
    {
      final SOAPHeaderElement securityHeader = SOAPExtractorUtil.extractSecurityHeader( soap.getSOAPPart().getEnvelope() );
      if ( securityHeader == null )
      {
        return null;
     
      Iterator childElements = securityHeader.getChildElements();
      while ( childElements.hasNext() )
      {
          final Node securityNode = (Node) childElements.next();
          if ( securityNode.getNodeType() == Node.ELEMENT_NODE )
          {
            final String localName = securityNode.getLocalName();
              if ( "BinarySecurityToken".equalsIgnoreCase( localName ) )
              {
                //  create a BinarySecurityToken (does some filtering and checking)
                final BinarySecurityToken binaryToken = createBinarySecurityToken(securityNode);
                //   add the key(cert) as a credential
                    credentials.add(binaryToken.getKey());
              }
              else if ( "UsernameToken".equalsIgnoreCase(localName) )
              {
                UsernameToken usernameToken = createUsernameToken(securityNode);
                final String userName = usernameToken.getUserName();
                if ( userName != null )
                {
                    user = new User(usernameToken.getUserName());
               
                char[] passwd = usernameToken.getPassword();
                if ( passwd != null )
                {
                credentials.add(passwd);
View Full Code Here

        {
            final Set<Principal> principals = subject.getPrincipals();
            String name = verifiedCertificate.getSubjectX500Principal().getName();
            // get the CN from the DN.
            name = name.substring(name.indexOf('=') + 1, name.indexOf(','));
            final User authenticatedPrincipal = new User(name);
            principals.add(authenticatedPrincipal);

            addRoles(subject, authenticatedPrincipal, verifiedCertificate, Collections.unmodifiableMap(options));
            return true;
        }
View Full Code Here

        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
        pipeline.initialise() ;
        checkOrder(MockActionInfo.getInitialiseList()) ;

        final Subject subject = new Subject();
        final User user = new User("AustinPowerwich");
        final byte[] publicCred = "publicsecret".getBytes();
        subject.getPrincipals().add(user);
        subject.getPublicCredentials().add(publicCred);

        //  Create and encrypt the security context. This simulates a call for a service that has already been authentcated.
View Full Code Here

        checkOrder(MockActionInfo.getInitialiseList()) ;


        Subject subject = new Subject();
        //  add principal
        User user = new User("AustinPowerwich");
        subject.getPrincipals().add(user);
        //  add public credentials
        byte[] publicCred = "publicsecret".getBytes();
        subject.getPublicCredentials().add(publicCred);
View Full Code Here

        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
        pipeline.initialise() ;
        checkOrder(MockActionInfo.getInitialiseList()) ;

        final Subject subject = new Subject();
        final User user = new User("AustinPowerwich");
        subject.getPrincipals().add(user);
        final byte[] publicCred = "publicsecret".getBytes();
        subject.getPublicCredentials().add(publicCred);

        final SecurityContext securityContext = new SecurityContext(subject, SecurityContext.getConfigurationTimeout(), DOMAIN);
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.services.security.principals.User

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.