Package org.apache.geronimo.security

Examples of org.apache.geronimo.security.PrimaryRealmPrincipal


                    Principal p = null;
                    Class clazz = bundle.loadClass(className);
                    Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
                    p = (Principal) constructor.newInstance(principalName);

                    return new PrimaryRealmPrincipal(realm, domain, p);
                }
            });
        } catch (PrivilegedActionException pae) {
            throw new DeploymentException("Unable to create realm principal", pae.getException());
        }
View Full Code Here


                    java.security.Principal p = null;
                    Class clazz = classLoader.loadClass(className);
                    Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
                    p = (java.security.Principal) constructor.newInstance(new Object[]{principalName});

                    return new PrimaryRealmPrincipal(realm, domain, p);
                }
            });
        } catch (PrivilegedActionException pae) {
            throw new DeploymentException("Unable to create realm principal", pae.getException());
        }
View Full Code Here

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

        defaultSubject.getPrincipals().add(realmPrincipal);
View Full Code Here

                    java.security.Principal p = null;
                    Class clazz = Class.forName(principal.getClassName());
                    Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
                    p = (java.security.Principal) constructor.newInstance(new Object[]{principal.getPrincipalName()});

                    return new PrimaryRealmPrincipal(realmName, p);
                }
            });
        } catch (PrivilegedActionException e) {
            return null;
        }
View Full Code Here

        RealmPrincipal realmPrincipal = ConfigurationUtil.generateRealmPrincipal(realm, domain, className, principalName, classLoader);
        if (realmPrincipal == null) {
            throw new GeronimoSecurityException("Unable to create realm principal");
        }
        PrimaryRealmPrincipal primaryRealmPrincipal = null;
        try {
            primaryRealmPrincipal = ConfigurationUtil.generatePrimaryRealmPrincipal(realm, domain, className, principalName, classLoader);
        } catch (DeploymentException e) {
            throw new GeronimoSecurityException("Unable to create primary realm principal", e);
        }
View Full Code Here

        Subject subject = new Subject();
        subject.getPrincipals().add(basePrincipal);
        if (realmName != null && domainName != null) {
            subject.getPrincipals().add(new RealmPrincipal(realmName, domainName, basePrincipal));
            subject.getPrincipals().add(new PrimaryRealmPrincipal(realmName, domainName, basePrincipal));
        }
        if (domainName != null) {
            subject.getPrincipals().add(new DomainPrincipal(domainName, basePrincipal));
            subject.getPrincipals().add(new PrimaryDomainPrincipal(domainName, basePrincipal));
        }
View Full Code Here

        X500Principal x500Principal = new X500Principal(principalNameBytes);
        subject.getPrincipals().add(x500Principal);

        if (realmName != null && domainName != null) {
            subject.getPrincipals().add(new RealmPrincipal(realmName, domainName, x500Principal));
            subject.getPrincipals().add(new PrimaryRealmPrincipal(realmName, domainName, x500Principal));
        }
        if (domainName != null) {
            subject.getPrincipals().add(new DomainPrincipal(domainName, x500Principal));
            subject.getPrincipals().add(new PrimaryDomainPrincipal(domainName, x500Principal));
        }
View Full Code Here

                    java.security.Principal p = null;
                    Class clazz = classLoader.loadClass(className);
                    Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
                    p = (java.security.Principal) constructor.newInstance(new Object[]{principalName});

                    return new PrimaryRealmPrincipal(realm, domain, p);
                }
            });
        } catch (PrivilegedActionException pae) {
            throw new DeploymentException("Unable to create realm principal", pae.getException());
        }
View Full Code Here

                    Principal p = null;
                    Class clazz = classLoader.loadClass(className);
                    Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
                    p = (Principal) constructor.newInstance(new Object[]{principalName});

                    return new PrimaryRealmPrincipal(realm, domain, p);
                }
            });
        } catch (PrivilegedActionException pae) {
            throw new DeploymentException("Unable to create realm principal", pae.getException());
        }
View Full Code Here

        DefaultPrincipal principal = securityConfig.getDefaultPrincipal();

        RealmPrincipal realmPrincipal = ConfigurationUtil.generateRealmPrincipal(principal.getPrincipal(), principal.getRealmName());
        if (realmPrincipal == null) throw new GeronimoSecurityException("Unable to create realm principal");
        PrimaryRealmPrincipal primaryRealmPrincipal = ConfigurationUtil.generatePrimaryRealmPrincipal(principal.getPrincipal(), principal.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

TOP

Related Classes of org.apache.geronimo.security.PrimaryRealmPrincipal

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.