Package org.apache.geronimo.common

Examples of org.apache.geronimo.common.GeronimoSecurityException


                addValve(defaultSubjectValve);

                // if a servlet uses run-as then make sure role desgnates have been provided
                if (hasRunAsServlet()) {
                    if (runAsSource == null) {
                        throw new GeronimoSecurityException("web.xml or annotation specifies a run-as role but no subject configuration supplied for run-as roles");
                    }
                } else {
                    // optimization
                    this.removeInstanceListener(RunAsInstanceListener.class.getName());
                }
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

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

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

            throws GeronimoSecurityException {
        refreshUsers();
        String name = (String) properties.get("UserName");
        if (users.getProperty(name) == null) {
            log.warn("updateUserPrincipal() UserName="+name+" does not exist.");
            throw new GeronimoSecurityException("User principal="+name+" does not exist.");
        }
        try {
            String realPassword = (String) properties.get("Password");
            if (realPassword != null) {
                String digest = getDigest();
                if(digest != null && !digest.equals("")) {
                    realPassword = digestPassword(realPassword, digest, getEncoding());
                }
                realPassword = EncryptionManager.encrypt(realPassword);
            }
            users.setProperty(name, realPassword);
            store(users, serverInfo.resolveServer(getUsersURI()).toURL());
        } catch (Exception e) {
            throw new GeronimoSecurityException("Cannot update user principal: "
                    + e.getMessage(), e);
        }
    }
View Full Code Here

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

        refreshGroups();
        try {
            groups.remove(groupPrincipal);
            store(groups, serverInfo.resolveServer(getGroupsURI()).toURL());
        } catch (Exception e) {
            throw new GeronimoSecurityException(
                    "Cannot remove group principal: " + e.getMessage(), e);
        }
    }
View Full Code Here

        //same as add group principal
        refreshGroups();
        String group = (String) properties.get("GroupName");
        if (groups.getProperty(group) == null) {
            log.warn("updateGroupPrincipal() GroupName="+group+" does not exist.");
            throw new GeronimoSecurityException("Group principal="+group+" does not exist.");
        }
        try {
            groups.setProperty(group, (String) properties.get("Members"));
            store(groups, serverInfo.resolveServer(getGroupsURI()).toURL());
        } catch (Exception e) {
            throw new GeronimoSecurityException("Cannot update group principal: "
                    + e.getMessage(), e);
        }
    }
View Full Code Here

        }
    }

    public void addToGroup(String userPrincipal, String groupPrincipal)
            throws GeronimoSecurityException {
        throw new GeronimoSecurityException(
                "Not implemented for properties file security realm...");
    }
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.