Examples of AuthenticationRequest


Examples of org.apache.openejb.client.AuthenticationRequest

    }

    @Override
    public Response processRequest(final ObjectInputStream in, final ProtocolMetaData metaData) throws Exception {

        final AuthenticationRequest req = new AuthenticationRequest();
        req.setMetaData(metaData);

        final AuthenticationResponse res = new AuthenticationResponse();
        res.setMetaData(metaData);

        try {
            req.readExternal(in);

            final String securityRealm = req.getRealm();
            final String username = req.getUsername();
            final String password = req.getCredentials();

            final SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
            final Object token = securityService.login(securityRealm, username, password);

            final ClientMetaData client = new ClientMetaData();
View Full Code Here

Examples of org.apache.openejb.client.AuthenticationRequest

    }

    @Override
    public Response processRequest(final ObjectInputStream in, final ProtocolMetaData metaData) throws Exception {

        final AuthenticationRequest req = new AuthenticationRequest();
        req.setMetaData(metaData);

        final AuthenticationResponse res = new AuthenticationResponse();
        res.setMetaData(metaData);

        try {
            req.readExternal(in);

            final String securityRealm = req.getRealm();
            final String username = req.getUsername();
            final String password = req.getCredentials();

            final SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
            final Object token = securityService.login(securityRealm, username, password);

            final ClientMetaData client = new ClientMetaData();
View Full Code Here

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

      //No auth request, maybe it was a SAML v2 Assertion in the security header. Let's try to add it
      try
      {
        Set<SecurityInfoExtractor<String>> extractors = new HashSet<SecurityInfoExtractor<String>>();
        extractors.add( new SamlAssertionExtractor() );
        AuthenticationRequest authRequest = ExtractorUtil.extract(message.getBody().get().toString(), extractors);
        ExtractorUtil.addAuthRequestToMessage(authRequest, message);
      }
      catch( ExtractionException e )
      {
        throw new MessageDeliverException( e.getMessage(), e );
View Full Code Here

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

  @Test
  public void extractSecurityInfoBinarySecurityToken() throws Exception
  {
    WSSecuritySoapExtractor extractor = new WSSecuritySoapExtractor();
    SOAPMessage soap = WSTestUtil.createWithBinarySecurityToken("wsse:Base64Binary", "wsse:X509v3", WSTestUtil.getStringFromFile("cert-example.xml", getClass()));
    AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
   
    assertNotNull(authRequest);
    assertTrue(authRequest.getCredentials().size() == 1 );
    assertTrue(authRequest.getCredentials().iterator().next() instanceof X509Certificate );
  }
View Full Code Here

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

  public void extractSecurityInfoBinarySecurityTokenNoNSPrifix() throws Exception
  {
    WSSecuritySoapExtractor extractor = new WSSecuritySoapExtractor();
    //  create the SAOPMessage with out namespace prefixes for ValueType and EncodingType
    SOAPMessage soap = WSTestUtil.createWithBinarySecurityToken("Base64Binary", "X509v3", WSTestUtil.getStringFromFile("cert-example.xml", getClass()));
    AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
   
    assertNotNull(authRequest);
    assertTrue(authRequest.getCredentials().size() == 1 );
    assertTrue(authRequest.getCredentials().iterator().next() instanceof X509Certificate );
  }
View Full Code Here

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

  @Test
  public void extractSecurityInfoBinarySecurityTokenFromFile() throws Exception
  {
    WSSecuritySoapExtractor extractor = new WSSecuritySoapExtractor();
    SOAPMessage soap = WSTestUtil.createMessage("soap-keys-example.xml", getClass());
    AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
   
    assertNotNull(authRequest);
    assertTrue(authRequest.getCredentials().size() == 1 );
    assertTrue(authRequest.getCredentials().iterator().next() instanceof X509Certificate );
  }
View Full Code Here

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

  {
    final String username = "Bubbles";
    final String password = "228833dkd0";
    WSSecuritySoapExtractor extractor = new WSSecuritySoapExtractor();
    SOAPMessage soap = WSTestUtil.createWithUsernameToken(username, password);
    AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
   
    assertNotNull(authRequest);
    assertEquals(username, authRequest.getPrincipal().getName());
    assertTrue(authRequest.getCredentials().size() == 1 );
    assertTrue(authRequest.getCredentials().iterator().next() instanceof char[] );
  }
View Full Code Here

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

  public void extractSecurityInfoUsernameTokenNoUsername() throws Exception
  {
    final String password = "228833dkd0";
    WSSecuritySoapExtractor extractor = new WSSecuritySoapExtractor();
    SOAPMessage soap = WSTestUtil.createWithUsernameToken(null, password);
    AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
   
    assertNotNull(authRequest);
    assertEquals(null, authRequest.getPrincipal() );
    assertTrue(authRequest.getCredentials().size() == 1 );
    assertTrue(authRequest.getCredentials().iterator().next() instanceof char[] );
  }
View Full Code Here

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

  public void extractSecurityInfoUsernameTokenNoPassword() throws Exception
  {
    final String username = "Bubbles";
    WSSecuritySoapExtractor extractor = new WSSecuritySoapExtractor();
    SOAPMessage soap = WSTestUtil.createWithUsernameToken(username, null);
    AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);
   
    assertNotNull(authRequest);
    assertEquals(username, authRequest.getPrincipal().getName());
    assertTrue(authRequest.getCredentials().size() == 0 );
  }
View Full Code Here

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

    public void extractAssertionFromSOAPMessage() throws Exception
    {
        final SamlSoapAssertionExtractor extractor = new SamlSoapAssertionExtractor();
        final SOAPMessage soap = WSTestUtil.createMessage("soap-saml-example.xml", getClass());

        final AuthenticationRequest authRequest = extractor.extractSecurityInfo(soap);

        assertNotNull(authRequest);
        final Set<?> credentials = authRequest.getCredentials();
        assertFalse(credentials.isEmpty());
        assertEquals(1, credentials.size());
        final Object credential = credentials.iterator().next();
        assertTrue(credential instanceof SamlCredential);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.