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

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


    public static boolean addAuthDetailsToMessage(HttpServletRequest request, Message message) throws ServletException {

            // Need to get the login details from the request
        // and pass it along in the ESB Message sent to the Service...
            AuthenticationRequest authRequest = buildAuthenticationRequest(request);

            if (authRequest != null) {
              // It's a logged in user. Set the AuthenticationRequest on the inbound message...
              try {
                  return PublicCryptoUtil.INSTANCE.addAuthRequestToMessage(authRequest, message);
View Full Code Here


  public static final String USERNAME_KEY = "http.basic.username";
  public static final String PASSWORD_KEY = "http.basic.password";
 
  public AuthenticationRequest extractSecurityInfo( final Map<String,Object> request )
  {
    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>();
View Full Code Here

                    String payload = new String(bodyBytes, charset.name());

                    payloadProxy.setPayload(message, payload);

                    // In case it's a SOAP message, we need to check for WS-S info...
                    AuthenticationRequest authRequest = null;
                    try {
                      authRequest = ExtractorUtil.extract(payload, extractors);
                    } catch (final ExtractionException e) {
                        throw new MessageDeliverException(e.getMessage(), e);
                    }
View Full Code Here

            Map properties = invocationRequest.getRequestPayload();


            if (properties != null) {
                //  Extract any jbr http security information that may exist
                AuthenticationRequest authRequest = jbrHttpSecurityExtractor.extractSecurityInfo(properties);

                // Extract any ws security information that may exist
                Object payload = invocationRequest.getParameter();
                if ( authRequest == null && payload instanceof String) {
                   
View Full Code Here

        checkOrder(MockActionInfo.getInitialiseList()) ;

        final Message message = MessageFactory.getInstance().getMessage();

        //  Create an AuthenticationRequest which is needed to authenticate if the security
        final AuthenticationRequest authRequest = new AuthenticationRequestImpl.Builder().build();
        final byte[] encryptedAuthRequest = PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest);
        message.getContext().setContext(SecurityService.AUTH_REQUEST, encryptedAuthRequest);

        final boolean processingResult = pipeline.process(message);
View Full Code Here

            System.out.println("Usage SendEsbMessage <category> <name> <text to send> <username> <password>");
        }
        Message esbMessage = MessageFactory.getInstance().getMessage();
       
    //  create an AuthenticationRequest
    AuthenticationRequest authRequest = new AuthenticationRequestImpl.Builder().username(args[3]).password(args[4].toCharArray()).build();
   
    //   set the authentication request on the message
    esbMessage.getContext().setContext(SecurityService.AUTH_REQUEST, PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest));
   
        final String message = args[2];
View Full Code Here

  public void extractSecurityInfo()
  {
    Map<String,Object> metadata = createRequestMap(username, password);
   
    JbrHttpSecurityInfoExtractor extractor = new JbrHttpSecurityInfoExtractor();
    AuthenticationRequest authRequest = extractor.extractSecurityInfo(metadata);
   
    assertNotNull(authRequest);
    assertEquals(username, authRequest.getPrincipal().getName());
    char[] passwd = (char[]) authRequest.getCredentials().iterator().next();
    assertEquals(password, new String(passwd));
  }
View Full Code Here

    public void login() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
    {
        final Certificate callerCert = getCertificate(keyStorePath, keyAlias);

        // create the authentication request using the callers certificate as the credential
        final AuthenticationRequest authRequest = getAuthenticationRequest(callerCert);

        // create and setup the esb callback handler
        final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
        certCallbackHandler.setAuthenticationRequest(authRequest);
        certCallbackHandler.setSecurityConfig(getSecurityConfig(keyAlias));
View Full Code Here

    public void shouldThrowIsAliasIsNotFound() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
    {
        final Certificate callerCert = getCertificate(keyStorePath, keyAlias);

        // create the authentication request using the callers certificate as the credential
        final AuthenticationRequest authRequest = getAuthenticationRequest(callerCert);

        // create and setup the esb callback handler
        final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
        certCallbackHandler.setAuthenticationRequest(authRequest);
        certCallbackHandler.setSecurityConfig(getSecurityConfig("bogusAlias"));
View Full Code Here

    @Test (expected = LoginException.class)
    public void shouldThrowIfCertificateIsNull() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
    {
        // create the authentication request using the callers certificate as the credential
        final AuthenticationRequest authRequest = getAuthenticationRequest(null);

        // create and setup the esb callback handler
        final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
        certCallbackHandler.setAuthenticationRequest(authRequest);
        certCallbackHandler.setSecurityConfig(getSecurityConfig("bogusAlias"));
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.