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

Examples of org.jboss.soa.esb.services.security.SecurityServiceException


          final String moduleName = securityConf.getModuleName() ;
            if (securityContext == null || !securityContext.isValid() || ((moduleName != null) && !moduleName.equals(securityContext.getDomain())))
            {
                if (authRequest == null)
                {
                    throw new SecurityServiceException("Service '" + serviceName + "' has been configured for security but no AuthenticationRequest could be located in the Message Context. Cannot authenticate without an AuthenticationRequest.");
                }

                 // No existing security context exist or it had expired. Create a new one to drive the autentication.
                securityContext = new SecurityContext(new Subject(), getSecurityContextTimeout(securityConf), moduleName);

                // Authenticate the caller
              securityService.authenticate(securityConf, securityContext, authRequest);

                // Store the encrypted security context. Will be re-attached to outgoing messages.
              SecurityContext.setSecurityContext(SecurityContext.encryptContext(securityContext));
            }

            // Check that the caller is a member of atleast one of the declared roles.
            if (!securityService.checkRolesAllowed(securityConf.getRolesAllowed(), securityContext))
            {
              throw new SecurityServiceException("Caller did not belong to any of the rolesAllowed " + securityConf.getRolesAllowed());
            }
        }
    }
    catch (final SecurityServiceException e)
    {
View Full Code Here


        {
            return Cipher.getInstance(transformation);
        }
        catch (NoSuchAlgorithmException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
        catch (NoSuchPaddingException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
    }
View Full Code Here

        {
            cipher.init(Cipher.DECRYPT_MODE, key);
        }
        catch (InvalidKeyException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
        return cipher;
    }
View Full Code Here

        {
            cipher.init(Cipher.ENCRYPT_MODE, key);
        }
        catch (InvalidKeyException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
        return cipher;
    }
View Full Code Here

            cipher.init(Cipher.DECRYPT_MODE, key);
            return cipher.doFinal(bytes);
        }
        catch (final InvalidKeyException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
        catch (final IllegalBlockSizeException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
        catch (final BadPaddingException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
    }
View Full Code Here

            cipher.init(Cipher.ENCRYPT_MODE, key);
            return cipher.doFinal(text);
        }
        catch (InvalidKeyException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
        catch (IllegalBlockSizeException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
        catch (BadPaddingException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
    }
View Full Code Here

            {
                message.getContext().setContext(SecurityService.AUTH_REQUEST, encrypted);
            }
            else
            {
                throw new SecurityServiceException("No public keystore has been configured which means that the authentication request cannot be encrypted. Please configure jbossesb-properties.xml with a publickey store.");
            }
        }
    }
View Full Code Here

        {
            return ExtractorUtil.extract(request, extractors);
        }
        catch (final ExtractionException e)
        {
            throw new SecurityServiceException(e.getMessage(), e);
        }
    }
View Full Code Here

            Object newInstance = propagator.newInstance();
            return (SecurityContextPropagator) newInstance;
        }
        catch (final ClassNotFoundException e)
        {
            throw new SecurityServiceException("SecurityContextPropagator implementation '" + className + "' not found", e);
        }
        catch (final InstantiationException e)
        {
            throw new SecurityServiceException("Instantiation Exception while trying to create a SecurityContextPropagator of type '" + className + "'", e);
        }
        catch (final IllegalAccessException e)
        {
            throw new SecurityServiceException("IllegalAccessException while trying to create a SecurityContextPropagator of type '" + className + "'", e);
        }
    }
View Full Code Here

        addRunAs(config.getRunAs(), securityContext.getSubject());

    }
    catch (final LoginException e)
    {
      throw new SecurityServiceException("Exception while trying to login:", e);
    }

  }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.services.security.SecurityServiceException

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.