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

Examples of org.jboss.soa.esb.services.security.auth.AuthenticationRequest


   
  @Test
  public void processEmptyHeaderWithUserNameElementInBody() throws Exception
  {
    String soap = createUserPassSoapString("soap-userpass-example2.xml");
    AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
    assertNull(authRequest);
  }
View Full Code Here


  @Test
  @Ignore
    public void performance() throws Exception
    {
    final String soap = createKeySoapString("soap-keys-example.xml");
        AuthenticationRequest authRequest = null;
       
        // warm up
        for (int i = 0; i < 50000; i++)
        {
            authRequest = extractor.extractSecurityInfo(soap);
        }
       
        final int iterations = 1000000;
        final long start = System.nanoTime();
        for (int i = 0; i < iterations; i++)
        {
            authRequest = extractor.extractSecurityInfo(soap);
        }
        final long duration = System.nanoTime() - start;
        System.out.println(iterations + " took : " + NANOSECONDS.toSeconds(duration) + "s");
       
    assertNotNull(authRequest);
    assertTrue( authRequest.getCredentials().size() > 0 );
    Object cert = authRequest.getCredentials().iterator().next();
    assertTrue( cert instanceof java.security.cert.X509Certificate);
    }
View Full Code Here

  @Test
  public void extractKeySecurityInfo() throws Exception
  {
    final String soap = createKeySoapString("soap-keys-example.xml");
    final AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
    assertNotNull(authRequest);
    assertTrue( authRequest.getCredentials().size() > 0 );
    final Object cert = authRequest.getCredentials().iterator().next();
    assertTrue( cert instanceof java.security.cert.X509Certificate);
  }
View Full Code Here

 
  @Test
  public void extractKeySecurityInfo2() throws Exception
  {
    final String soap = createKeySoapString("soap-keys-example2.xml");
    final AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
    assertNotNull(authRequest);
    assertTrue( authRequest.getCredentials().size() > 0 );
    final Object cert = authRequest.getCredentials().iterator().next();
    assertTrue( cert instanceof java.security.cert.X509Certificate);
  }
View Full Code Here

 
  @Test
  public void extractKeySecurityInfoUsingStringInput() throws Exception
  {
    final String soap = "some payload";
    final AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
    assertNull(authRequest);
  }
View Full Code Here

 
  @Test
  public void extractKeySecurityInfoUsingNullInput() throws Exception
  {
    final String soap = null;
    final AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
    assertNull(authRequest);
  }
View Full Code Here

    @Ignore
    public void performance() throws Exception
    {
        final SamlAssertionExtractor extractor = new SamlAssertionExtractor();
        final String soap = readFile("soap-saml-example.xml");
        @SuppressWarnings("unused")
        AuthenticationRequest authRequest = null;
       
        // warm up
        for (int i = 0; i < 5000; i++)
        {
View Full Code Here

    SecurityConfig configInfo = builder.build();
    TestPrincipal principal = new TestPrincipal(userName);
    Set<Object> credentials = new HashSet<Object>();
    credentials.add(password);

    AuthenticationRequest authRequest = new AuthenticationRequestImpl.Builder(principal, credentials).build();
    SecurityContext context = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
    service.configure();
    service.authenticate(configInfo, context, authRequest);

    Set<TestPrincipal> principals = subject.getPrincipals( TestPrincipal.class );
View Full Code Here

        {
        // Store the security context. Will be re-attached to outgoing messages regardless whether the service is secured or not.
            SecurityContext.setSecurityContext(sealedSecurityContext);
        }

    AuthenticationRequest authRequest;
    try
    {
        /*
         * Get the authentication reqeust if one exists. Note that this is needed even if
         * the current service does not require authentication. A service later down the line might
View Full Code Here

        {
            // No need to do anything if a security context propagator was not configured.
            return;
        }

        final AuthenticationRequest request;
        if (authRequest == null)
        {
            final byte[] encryptedAuthRequest = (byte[]) message.getContext().getContext(SecurityService.AUTH_REQUEST);
            if (encryptedAuthRequest == null)
            {
               // there might not be a authentication reqeust. Just return.
               return;
            }
            request = (AuthenticationRequest) PublicCryptoUtil.INSTANCE.decrypt(encryptedAuthRequest);
        }
        else
        {
            // use the passed in authentication request.
            request = authRequest;
        }

        securityContextPropagator.pushSecurityContext(context, request.getCredentials(), securityConf);
    }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.services.security.auth.AuthenticationRequest

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.