Examples of Pam


Examples of org.jvnet.libpam.PAM

    }
   
    @Override
    public Enumeration getGroupNames(String username) throws NoSuchUserException {  
        try {
            Set<String> groupsSet = new PAM(PAM_SERVICE).getGroupsOfUser(username);
            return Collections.enumeration(groupsSet);
        } catch (PAMException ex) {
            Logger.getLogger(PamRealm.class.getName()).log(Level.SEVERE,
                    "pam_exception_getgroupsofuser", ex);
            return null;
View Full Code Here

Examples of org.jvnet.libpam.PAM

        else {
            throw new LoginException("pamrealm.invalid_realm");
        }
      
        try {
            user = new PAM(pamService).authenticate(username, password);

        } catch (PAMException e) {
              _logger.log(Level.SEVERE, "pam_exception_authenticate", e);
        }
        return user;
View Full Code Here

Examples of org.jvnet.libpam.PAM

        else {
            throw new LoginException("pamrealm.invalid_realm");
        }
      
        try {
            user = new PAM(pamService).authenticate(username, password);

        } catch (PAMException e) {
              _logger.log(Level.SEVERE, "pam_exception_authenticate", e);
        }
        return user;
View Full Code Here

Examples of org.jvnet.libpam.PAM

    }
   
    @Override
    public Enumeration getGroupNames(String username) throws NoSuchUserException {  
        try {
            Set<String> groupsSet = new PAM(PAM_SERVICE).getGroupsOfUser(username);
            return Collections.enumeration(groupsSet);
        } catch (PAMException ex) {
            Logger.getLogger(PamRealm.class.getName()).log(Level.SEVERE,
                    "pam_exception_getgroupsofuser", ex);
            return null;
View Full Code Here

Examples of org.jvnet.libpam.PAM

    }
   
    @Override
    public Enumeration getGroupNames(String username) throws NoSuchUserException {  
        try {
            Set<String> groupsSet = new PAM(PAM_SERVICE).getGroupsOfUser(username);
            return Collections.enumeration(groupsSet);
        } catch (PAMException ex) {
            Logger.getLogger(PamRealm.class.getName()).log(Level.SEVERE,
                    "pam_exception_getgroupsofuser", ex);
            return null;
View Full Code Here

Examples of org.jvnet.libpam.PAM

        else {
            throw new LoginException("pamrealm.invalid_realm");
        }
      
        try {
            user = new PAM(pamService).authenticate(username, password);

        } catch (PAMException e) {
              _logger.log(Level.SEVERE, "pam_exception_authenticate", e);
        }
        return user;
View Full Code Here

Examples of org.jvnet.libpam.PAM

            if ((name == null) || (password == null)) {
                debug("user or pass is null");
                return false;
            }
            debug("PAM authentication trying (" + serviceName + ") for: " + name);
            UnixUser authenticate = new PAM(serviceName).authenticate(name, new String(password));
            debug("PAM authentication succeeded for: " + name);
            this.unixUser = authenticate;

            return true;
        } catch (PAMException e) {
View Full Code Here

Examples of org.jvnet.libpam.PAM

        else {
            throw new LoginException("pamrealm.invalid_realm");
        }
      
        try {
            user = new PAM(pamService).authenticate(username, password);

        } catch (PAMException e) {
              _logger.log(Level.SEVERE, "pam_exception_authenticate", e);
        }
        return user;
View Full Code Here

Examples of org.jvnet.libpam.PAM

   
    @Override
    public Enumeration getGroupNames(String username) throws NoSuchUserException {  
        try {
            Set<String> groupsSet = Collections.EMPTY_SET;
            groupsSet = new PAM(PAM_SERVICE).getGroupsOfUser(username);
            return Collections.enumeration(groupsSet);
        } catch (PAMException ex) {
            Logger.getLogger(PamRealm.class.getName()).log(Level.SEVERE,
                    "pam_exception_getgroupsofuser", ex);
            return null;
View Full Code Here

Examples of org.jvnet.libpam.PAM

        public Authentication authenticate(Authentication authentication) throws AuthenticationException {
            String username = authentication.getPrincipal().toString();
            String password = authentication.getCredentials().toString();

            try {
                UnixUser u = new PAM(serviceName).authenticate(username, password);
                Set<String> grps = u.getGroups();
                GrantedAuthority[] groups = new GrantedAuthority[grps.size()];
                int i=0;
                for (String g : grps)
                    groups[i++] = new GrantedAuthorityImpl(g);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.