Package org.springframework.security.access.event

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


        // Attempt authorization
        try {
            this.accessDecisionManager.decide(authenticated, object, attributes);
        }
        catch (AccessDeniedException accessDeniedException) {
            publishEvent(new AuthorizationFailureEvent(object, attributes, authenticated, accessDeniedException));

            throw accessDeniedException;
        }

        if (debug) {
View Full Code Here


                returnedObject = afterInvocationManager.decide(token.getSecurityContext().getAuthentication(),
                        token.getSecureObject(),
                        token.getAttributes(), returnedObject);
            }
            catch (AccessDeniedException accessDeniedException) {
                AuthorizationFailureEvent event = new AuthorizationFailureEvent(token.getSecureObject(), token
                        .getAttributes(), token.getSecurityContext().getAuthentication(), accessDeniedException);
                publishEvent(event);

                throw accessDeniedException;
            }
View Full Code Here

    private List<ConfigAttribute> attributes = SecurityConfig.createList("TEST");
    private AccessDeniedException exception = new AuthorizationServiceException("error", new Throwable());

    @Test(expected=IllegalArgumentException.class)
    public void rejectsNullSecureObject() {
        new AuthorizationFailureEvent(null, attributes, foo, exception);
    }
View Full Code Here

        new AuthorizationFailureEvent(null, attributes, foo, exception);
    }

    @Test(expected=IllegalArgumentException.class)
    public void rejectsNullAttributesList() {
        new AuthorizationFailureEvent(new SimpleMethodInvocation(), null, foo, exception);
    }
View Full Code Here

        new AuthorizationFailureEvent(new SimpleMethodInvocation(), null, foo, exception);
    }

    @Test(expected=IllegalArgumentException.class)
    public void rejectsNullAuthentication() {
        new AuthorizationFailureEvent(new SimpleMethodInvocation(), attributes, null, exception);
    }
View Full Code Here

        new AuthorizationFailureEvent(new SimpleMethodInvocation(), attributes, null, exception);
    }

    @Test(expected=IllegalArgumentException.class)
    public void rejectsNullException() {
        new AuthorizationFailureEvent(new SimpleMethodInvocation(), attributes, foo, null);
    }
View Full Code Here

        new AuthorizationFailureEvent(new SimpleMethodInvocation(), attributes, foo, null);
    }

    @Test
    public void gettersReturnCtorSuppliedData() throws Exception {
        AuthorizationFailureEvent event = new AuthorizationFailureEvent(new Object(), attributes , foo, exception);
        assertSame(attributes, event.getConfigAttributes());
        assertSame(exception, event.getAccessDeniedException());
        assertSame(foo, event.getAuthentication());
    }
View Full Code Here

            // Attempt authorization with exchange
            try {
                this.accessDecisionManager.decide(authenticated, exchange, attributes);
            } catch (AccessDeniedException accessDeniedException) {
                exchange.getIn().setHeader(Exchange.AUTHENTICATION_FAILURE_POLICY_ID, getId());
                AuthorizationFailureEvent event = new AuthorizationFailureEvent(exchange, attributes, authenticated,
                        accessDeniedException);
                publishEvent(event);
                throw accessDeniedException;
            }
            publishEvent(new AuthorizedEvent(exchange, attributes, authenticated));
View Full Code Here

            // Attempt authorization with exchange
            try {
                this.accessDecisionManager.decide(authenticated, exchange, attributes);
            } catch (AccessDeniedException accessDeniedException) {
                exchange.getIn().setHeader(Exchange.AUTHENTICATION_FAILURE_POLICY_ID, getId());
                AuthorizationFailureEvent event = new AuthorizationFailureEvent(exchange, attributes, authenticated,
                        accessDeniedException);
                publishEvent(event);
                throw accessDeniedException;
            }
            publishEvent(new AuthorizedEvent(exchange, attributes, authenticated));
View Full Code Here

            // Attempt authorization with exchange
            try {
                this.accessDecisionManager.decide(authenticated, exchange, attributes);
            } catch (AccessDeniedException accessDeniedException) {
                exchange.getIn().setHeader(Exchange.AUTHENTICATION_FAILURE_POLICY_ID, getId());
                AuthorizationFailureEvent event = new AuthorizationFailureEvent(exchange, attributes, authenticated,
                        accessDeniedException);
                publishEvent(event);
                throw accessDeniedException;
            }
            publishEvent(new AuthorizedEvent(exchange, attributes, authenticated));
View Full Code Here

TOP

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

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.