Examples of SubjectId


Examples of org.apache.geronimo.security.SubjectId

    public Object login(String user, String pass) throws LoginException {
        LoginContext context = new LoginContext("OpenEJB", new UsernamePasswordCallbackHandler(user, pass));
        context.login();

        Subject subject = context.getSubject();
        SubjectId subjectId = ContextManager.registerSubject(subject);
        return subjectId;
    }
View Full Code Here

Examples of org.apache.geronimo.security.SubjectId

            throw new ExpiredLoginModuleException();
        }

        Subject subject = session.getSubject();
        ContextManager.registerSubject(subject);
        SubjectId id = ContextManager.getSubjectId(subject);
        IdentificationPrincipal principal = new IdentificationPrincipal(id);
        subject.getPrincipals().add(principal);
        return principal;
    }
View Full Code Here

Examples of org.apache.geronimo.security.SubjectId

                    throw new GeronimoSecurityException("Unable to generate default principal");
                }

                defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal, ctx.getClassLoader());
                ContextManager.registerSubject(defaultSubject);
                SubjectId id = ContextManager.getSubjectId(defaultSubject);
                defaultSubject.getPrincipals().add(new IdentificationPrincipal(id));

                interceptor = new PolicyContextBeforeAfter(interceptor, index++, index++, index++, securityHolder.getPolicyContextID(), defaultSubject);

            }
View Full Code Here

Examples of org.apache.geronimo.security.SubjectId

    public void uninstall(Set<String> contextIds) throws PolicyContextException {
    }

    private void registerSubject(Subject subject) {
        ContextManager.registerSubject(subject);
        SubjectId id = ContextManager.getSubjectId(subject);
        subject.getPrincipals().add(new IdentificationPrincipal(id));
    }
View Full Code Here

Examples of org.apache.geronimo.security.SubjectId

    public void uninstall(Set<String> contextIds) throws PolicyContextException {
    }

    private void registerSubject(Subject subject) {
        ContextManager.registerSubject(subject);
        SubjectId id = ContextManager.getSubjectId(subject);
        subject.getPrincipals().add(new IdentificationPrincipal(id));
    }
View Full Code Here

Examples of org.apache.geronimo.security.SubjectId

        for (Iterator iterator = roleDesignates.entrySet().iterator(); iterator.hasNext();) {
            Map.Entry entry = (Map.Entry) iterator.next();
            Subject roleDesignate = (Subject) entry.getValue();
            ContextManager.registerSubject(roleDesignate);
            SubjectId id = ContextManager.getSubjectId(roleDesignate);
            roleDesignate.getPrincipals().add(new IdentificationPrincipal(id));
        }
        this.roleDesignates = roleDesignates;
    }
View Full Code Here

Examples of org.apache.geronimo.security.SubjectId

            if (principals.isEmpty()) {
                super.write(createClearSubjectPackt());
            } else {
                IdentificationPrincipal principal = (IdentificationPrincipal) principals.iterator().next();
                SubjectId subjectId = principal.getId();
                super.write(createSubjectPacket(subjectId.getSubjectId(), subjectId.getHash()));
            }

        }
        super.write(createPassthroughPacket(packet));
    }
View Full Code Here

Examples of org.apache.geronimo.security.SubjectId

            switch (packet.read()) {
                case CLEAR_SUBJECT:
                    localSubject = null;
                    return;
                case SET_SUBJECT:
                    SubjectId subjectId = extractSubjectId(packet);
                    localSubject = ContextManager.getRegisteredSubject(subjectId);
                    return;
                case PASSTHROUGH:
                    super.onPacket(new SubjectPacketFilter(packet));
            }
View Full Code Here

Examples of org.apache.geronimo.security.SubjectId

     */
    private SubjectId extractSubjectId(Packet packet) throws IOException {
        DataInputStream is = new DataInputStream(new PacketToInputStream(packet));
        Long id = new Long(is.readLong());
        byte hash[] = new byte[is.readInt()];
        return new SubjectId(id, hash);
    }
View Full Code Here

Examples of org.apache.geronimo.security.SubjectId

            throw new ExpiredLoginModuleException();
        }

        Subject subject = context.getSubject();
        ContextManager.registerSubject(subject);
        SubjectId id = ContextManager.getSubjectId(subject);
        IdentificationPrincipal principal = new IdentificationPrincipal(id);
        subject.getPrincipals().add(principal);
        SecurityRealm realm = getRealm(context.getRealmName());
        if (realm.isRestrictPrincipalsToServer()) {
            return new Principal[]{principal};
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.