Package org.apache.geronimo.common

Examples of org.apache.geronimo.common.GeronimoSecurityException


     * @param defaultPrincipal
     * @return the default principal
     */
    public static Subject generateDefaultSubject(DefaultPrincipal defaultPrincipal) throws GeronimoSecurityException {
        if (defaultPrincipal == null) {
            throw new GeronimoSecurityException("No DefaultPrincipal configuration supplied");
        }
        Subject defaultSubject = new Subject();

        RealmPrincipal realmPrincipal = generateRealmPrincipal(defaultPrincipal.getPrincipal(), defaultPrincipal.getRealmName());
        if (realmPrincipal == null) {
            throw new GeronimoSecurityException("Unable to create realm principal");
        }
        PrimaryRealmPrincipal primaryRealmPrincipal = generatePrimaryRealmPrincipal(defaultPrincipal.getPrincipal(), defaultPrincipal.getRealmName());
        if (primaryRealmPrincipal == null) {
            throw new GeronimoSecurityException("Unable to create primary realm principal");
        }

        defaultSubject.getPrincipals().add(realmPrincipal);
        defaultSubject.getPrincipals().add(primaryRealmPrincipal);

View Full Code Here


                }
            }

        } catch (Exception e) {
            log.error("Properties File Login Module - data load failed", e);
            throw new GeronimoSecurityException(e);
        }
    }
View Full Code Here

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

                }
            }

        } catch (Exception e) {
            log.error("Properties File Login Module - data load failed", e);
            throw new GeronimoSecurityException(e);
        }
    }
View Full Code Here

    public LoginModule getLoginModule(ClassLoader loader) throws GeronimoSecurityException {
        try {
            return (LoginModule) loader.loadClass(loginModuleName).newInstance();
        } catch (Exception e) {
            throw new GeronimoSecurityException("Unable to instantiate login module", e);
        }
    }
View Full Code Here

                }
            }

        } catch (Exception e) {
            log.error("Properties File Login Module - data load failed", e);
            throw new GeronimoSecurityException(e);
        }
    }
View Full Code Here

    private void refreshUsers() {
        users.clear();
        try {
            users.load(serverInfo.resolve(getUsersURI()).toURL().openStream());
        } catch (Exception e) {
            throw new GeronimoSecurityException(e);
        }
    }
View Full Code Here

        try {
            groups
                    .load(serverInfo.resolve(getGroupsURI()).toURL()
                            .openStream());
        } catch (Exception e) {
            throw new GeronimoSecurityException(e);
        }
    }
View Full Code Here

    public String[] getUsers() throws GeronimoSecurityException {
        users.clear();
        try {
            users.load(serverInfo.resolve(getUsersURI()).toURL().openStream());
        } catch (Exception e) {
            throw new GeronimoSecurityException(e);
        }
        return (String[]) users.keySet().toArray(new String[0]);
    }
View Full Code Here

        try {
            groups
                    .load(serverInfo.resolve(getGroupsURI()).toURL()
                            .openStream());
        } catch (Exception e) {
            throw new GeronimoSecurityException(e);
        }
        return (String[]) groups.keySet().toArray(new String[0]);
    }
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.