Package org.springframework.security.access.event

Examples of org.springframework.security.access.event.AuthorizedEvent


        if (debug) {
            logger.debug("Authorization successful");
        }

        if (publishAuthorizationSuccess) {
            publishEvent(new AuthorizedEvent(object, attributes, authenticated));
        }

        // Attempt to run as a different user
        Authentication runAs = this.runAsManager.buildRunAs(authenticated, object, attributes);
View Full Code Here


*/
public class AuthorizedEventTests {

    @Test(expected=IllegalArgumentException.class)
    public void testRejectsNulls() {
        new AuthorizedEvent(null, SecurityConfig.createList("TEST"), new UsernamePasswordAuthenticationToken("foo", "bar"));
    }
View Full Code Here

    }

    @Test(expected=IllegalArgumentException.class)
    public void testRejectsNulls2() {

        new AuthorizedEvent(new SimpleMethodInvocation(), null, new UsernamePasswordAuthenticationToken("foo", "bar"));
    }
View Full Code Here

        new AuthorizedEvent(new SimpleMethodInvocation(), null, new UsernamePasswordAuthenticationToken("foo", "bar"));
    }

    @Test(expected=IllegalArgumentException.class)
    public void testRejectsNulls3() {
        new AuthorizedEvent(new SimpleMethodInvocation(), SecurityConfig.createList("TEST"), null);
    }
View Full Code Here

                AuthorizationFailureEvent event = new AuthorizationFailureEvent(exchange, attributes, authenticated,
                        accessDeniedException);
                publishEvent(event);
                throw accessDeniedException;
            }
            publishEvent(new AuthorizedEvent(exchange, attributes, authenticated));
           
        } catch (RuntimeException exception) {
            CamelAuthorizationException authorizationException =
                new CamelAuthorizationException("Cannot access the processor which has been protected.", exchange, exception);
            throw authorizationException;
View Full Code Here

                AuthorizationFailureEvent event = new AuthorizationFailureEvent(exchange, attributes, authenticated,
                        accessDeniedException);
                publishEvent(event);
                throw accessDeniedException;
            }
            publishEvent(new AuthorizedEvent(exchange, attributes, authenticated));
           
        } catch (RuntimeException exception) {
            exchange.getIn().setHeader(Exchange.AUTHENTICATION_FAILURE_POLICY_ID, getId());
            CamelAuthorizationException authorizationException =
                new CamelAuthorizationException("Cannot access the processor which has been protected.", exchange, exception);
View Full Code Here

                AuthorizationFailureEvent event = new AuthorizationFailureEvent(exchange, attributes, authenticated,
                        accessDeniedException);
                publishEvent(event);
                throw accessDeniedException;
            }
            publishEvent(new AuthorizedEvent(exchange, attributes, authenticated));
           
        } catch (RuntimeException exception) {
            exchange.getIn().setHeader(Exchange.AUTHENTICATION_FAILURE_POLICY_ID, getId());
            CamelAuthorizationException authorizationException =
                new CamelAuthorizationException("Cannot access the processor which has been protected.", exchange, exception);
View Full Code Here

                AuthorizationFailureEvent event = new AuthorizationFailureEvent(exchange, attributes, authenticated,
                        accessDeniedException);
                publishEvent(event);
                throw accessDeniedException;
            }
            publishEvent(new AuthorizedEvent(exchange, attributes, authenticated));
           
        } catch (RuntimeException exception) {
            exchange.getIn().setHeader(Exchange.AUTHENTICATION_FAILURE_POLICY_ID, getId());
            CamelAuthorizationException authorizationException =
                new CamelAuthorizationException("Cannot access the processor which has been protected.", exchange, exception);
View Full Code Here

                AuthorizationFailureEvent event = new AuthorizationFailureEvent(exchange, attributes, authenticated,
                        accessDeniedException);
                publishEvent(event);
                throw accessDeniedException;
            }
            publishEvent(new AuthorizedEvent(exchange, attributes, authenticated));
           
        } catch (RuntimeException exception) {
            exchange.getIn().setHeader(Exchange.AUTHENTICATION_FAILURE_POLICY_ID, getId());
            CamelAuthorizationException authorizationException =
                new CamelAuthorizationException("Cannot access the processor which has been protected.", exchange, exception);
View Full Code Here

        if (debug) {
            logger.debug("Authorization successful");
        }

        publishEvent(new AuthorizedEvent(object, attributes, authenticated));

        // Attempt to run as a different user
        Authentication runAs = this.runAsManager.buildRunAs(authenticated, object, attributes);

        if (runAs == null) {
View Full Code Here

TOP

Related Classes of org.springframework.security.access.event.AuthorizedEvent

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.