Package org.apache.geronimo.common

Examples of org.apache.geronimo.common.GeronimoSecurityException


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


        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

        }
    }

    public void addToGroup(String userPrincipal, String groupPrincipal)
            throws GeronimoSecurityException {
        throw new GeronimoSecurityException(
                "Not implemented for properties file security realm...");
    }
View Full Code Here

                "Not implemented for properties file security realm...");
    }

    public void removeFromGroup(String userPrincipal, String groupPrincipal)
            throws GeronimoSecurityException {
        throw new GeronimoSecurityException(
                "Not implemented for properties file security realm...");
    }
View Full Code Here

     */
    public JaasSessionId connectToRealm(String realmName) {
        SecurityRealm realm;
        realm = getRealm(realmName);
        if (realm == null) {
            throw new GeronimoSecurityException("No such realm (" + realmName + ")");
        } else {
            return initializeClient(realm);
        }
    }
View Full Code Here

                /**
                 * 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

        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

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.