Examples of AuthenticationRequest


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

        {
        // 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

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

        {
            // 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

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

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

  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

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

                    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

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

            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

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

        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

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

            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

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

  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

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

    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
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.