Package org.apache.activemq.shiro.subject

Examples of org.apache.activemq.shiro.subject.SubjectConnectionReference


            @Override
            public boolean isAuthenticated() {
                return true;
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertFalse(policy.isAuthenticationRequired(sc));
    }
View Full Code Here


            @Override
            public PrincipalCollection getPrincipals() {
                return new SimplePrincipalCollection("anonymous", "iniRealm");
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertFalse(policy.isAuthenticationRequired(sc));
    }
View Full Code Here

            @Override
            public PrincipalCollection getPrincipals() {
                return new SimplePrincipalCollection("system", "iniRealm");
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertFalse(policy.isAuthenticationRequired(sc));
    }
View Full Code Here

            @Override
            public PrincipalCollection getPrincipals() {
                return new SimplePrincipalCollection("system", "iniRealm");
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertFalse(policy.isAuthenticationRequired(sc));
    }
View Full Code Here

            @Override
            public PrincipalCollection getPrincipals() {
                return new SimplePrincipalCollection("system", "iniRealm");
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertTrue(policy.isAuthenticationRequired(sc));
    }
View Full Code Here

            @Override
            public PrincipalCollection getPrincipals() {
                return new SimplePrincipalCollection("foo", "iniRealm");
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertTrue(policy.isAuthenticationRequired(sc));
    }
View Full Code Here

            }
        };

        ctx.setConnection(connection);

        SubjectConnectionReference sc = new SubjectConnectionReference(ctx, new ConnectionInfo(),
                new DefaultEnvironment(), new SubjectAdapter());

        assertTrue(policy.isAssumeIdentity(sc));
    }
View Full Code Here

            @Override
            public org.apache.shiro.mgt.SecurityManager getSecurityManager() {
                return null; //not needed in this test.
            }
        };
        SubjectConnectionReference ref = new SubjectConnectionReference(ctx, info, environment, subject);
        SubjectSecurityContext secCtx = new SubjectSecurityContext(ref);
        ctx.setSecurityContext(secCtx);
        return ctx;
    }
View Full Code Here

            }
        };

        ConnectionContext ctx = new ConnectionContext();
        ConnectionInfo info = new ConnectionInfo();
        SubjectConnectionReference conn = new SubjectConnectionReference(ctx, info, env, subject);
        SubjectSecurityContext ssc = new SubjectSecurityContext(conn);
        ctx.setSecurityContext(ssc);

        filter.removeConnection(ctx, info, null);
View Full Code Here

            Subject subject = getSubject(new ConnectionReference(context, info, getEnvironment()));

            if (!subject.isAuthenticated()) {

                SubjectConnectionReference connection = new SubjectConnectionReference(context, info, getEnvironment(), subject);

                if (this.authenticationPolicy.isAuthenticationRequired(connection)) {
                    AuthenticationToken token = this.authenticationTokenFactory.getAuthenticationToken(connection);
                    if (token == null) {
                        String msg = "Unable to obtain authentication credentials for newly established connection.  " +
View Full Code Here

TOP

Related Classes of org.apache.activemq.shiro.subject.SubjectConnectionReference

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.