Package org.apache.geronimo.common

Examples of org.apache.geronimo.common.GeronimoSecurityException


                /**
                 * Register our default subject with the ContextManager
                 */
                DefaultPrincipal defaultPrincipal = securityHolder.getDefaultPrincipal();
                if (defaultPrincipal == null) {
                    throw new GeronimoSecurityException("Unable to generate default principal");
                }

                defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal, ctx.getClassLoader());
                ContextManager.registerSubject(defaultSubject);
                SubjectId id = ContextManager.getSubjectId(defaultSubject);
View Full Code Here


    protected JAASJettyPrincipal generateDefaultPrincipal(
            DefaultPrincipal defaultPrincipal, ClassLoader classLoader)
            throws GeronimoSecurityException {

        if (defaultPrincipal == null) {
            throw new GeronimoSecurityException(
                    "Unable to generate default principal");
        }

        try {
            JAASJettyPrincipal result = new JAASJettyPrincipal("default");
            Subject defaultSubject = ConfigurationUtil.generateDefaultSubject(
                    defaultPrincipal, classLoader);

            result.setSubject(defaultSubject);

            return result;
        } catch (DeploymentException de) {
            throw new GeronimoSecurityException(
                    "Unable to generate default principal", de);
        }
    }
View Full Code Here

        InputStream in = null;
        try {
            in = serverInfo.resolveServer(getUsersURI()).toURL().openStream();
            users.load(in);
        } catch (Exception e) {
            throw new GeronimoSecurityException(e);
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException ignored) {
View Full Code Here

        InputStream in = null;
        try {
            in = serverInfo.resolveServer(getGroupsURI()).toURL().openStream();
            groups.load(in);
        } catch (Exception e) {
            throw new GeronimoSecurityException(e);
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException ignored) {
View Full Code Here

        InputStream in = null;
        try {
            in = serverInfo.resolveServer(getUsersURI()).toURL().openStream();
            users.load(in);
        } catch (Exception e) {
            throw new GeronimoSecurityException(e);
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException ignored) {
View Full Code Here

        InputStream in = null;
        try {
            in = serverInfo.resolveServer(getGroupsURI()).toURL().openStream();
            groups.load(in);
        } catch (Exception e) {
            throw new GeronimoSecurityException(e);
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException ignored) {
View Full Code Here

    }

    public void addUserPrincipal(Hashtable properties)
            throws GeronimoSecurityException {
        if (users.getProperty((String) properties.get("UserName")) != null) {
            throw new GeronimoSecurityException("User principal "
                    + properties.get("UserName") + " already exists.");
        }
        try {
            refreshUsers();
            String digest = getDigest();
            String user = (String) properties.get("UserName");
            String password = (String) properties.get("Password");
            if(digest != null && !digest.equals("")) {
                password = digestPassword(password, digest);
            }
            users.setProperty(user, password);
            store(users, serverInfo.resolveServer(getUsersURI()).toURL());
        } catch (Exception e) {
            throw new GeronimoSecurityException("Cannot add user principal: "
                    + e.getMessage());
        }
    }
View Full Code Here

        try {
            refreshUsers();
            users.remove(userPrincipal);
            store(users, serverInfo.resolveServer(getUsersURI()).toURL());
        } catch (Exception e) {
            throw new GeronimoSecurityException("Cannot remove user principal "
                    + userPrincipal + ": " + e.getMessage());
        }
    }
View Full Code Here

                password = digestPassword(password, digest);
            }
            users.setProperty(user, password);
            store(users, serverInfo.resolveServer(getUsersURI()).toURL());
        } catch (Exception e) {
            throw new GeronimoSecurityException("Cannot add user principal: "
                    + e.getMessage());
        }
    }
View Full Code Here

    public void addGroupPrincipal(Hashtable properties)
            throws GeronimoSecurityException {
        refreshGroups();
        if (groups.getProperty((String) properties.get("GroupName")) != null) {
            throw new GeronimoSecurityException("Group "
                    + properties.get("GroupName") + " already exists.");
        }
        try {
            groups.setProperty((String) properties.get("GroupName"),
                    (String) properties.get("Members"));
            store(groups, serverInfo.resolveServer(getGroupsURI()).toURL());
        } catch (Exception e) {
            throw new GeronimoSecurityException("Cannot add group principal: "
                    + e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.common.GeronimoSecurityException

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.