Package org.jvnet.libpam

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


   
    @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

        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

Related Classes of org.jvnet.libpam.PAM

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.