Package net.sf.jpam

Examples of net.sf.jpam.Pam


    // Add generated JAAS Configuration
    CoreJAASConfiguration config = (CoreJAASConfiguration) Configuration.getConfiguration();
    config.addAppConfigurationEntry(PAMUserDatabase.class.getName(), entry);

    // Instantiate members with Property dependencies
    pam = new Pam(serviceName);

    // Add defaults groups
    addGroup("Users");
   
  }
View Full Code Here


        this.service = service;
    }

    public boolean authenticate(String username, String password, ServerSession session) {
        LOG.info("Authenticating user {} using PAM", username);
        PamReturnValue val = new Pam(service).authenticate(username, password);
        LOG.info("Result: {}", val);
        if (PamReturnValue.PAM_SUCCESS.equals(val)) {
            return true;
        }
        return false;
View Full Code Here

        this.service = service;
    }

    public Object authenticate(String username, String password) {
        LOG.info("Authenticating user {} using PAM", username);
        PamReturnValue val = new Pam(service).authenticate(username, password);
        LOG.info("Result: {}", val);
        if (PamReturnValue.PAM_SUCCESS.equals(val)) {
            return username;
        }
        return null;
View Full Code Here

            UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            // When the server side need to authenticate the user
            WSPasswordCallback pwcb = (WSPasswordCallback) callbacks[i];
            if (pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) {
                Pam pam = new Pam();
                PamReturnValue ret = pam.authenticate(pwcb.getIdentifer(), pwcb
                        .getPassword());
                if (ret.equals(PamReturnValue.PAM_SUCCESS)) {
                    return;
                } else {
                    throw new IOException("check failed");
View Full Code Here

        this.service = service;
    }

    public Object authenticate(String username, String password, ServerSession session) {
        LOG.info("Authenticating user {} using PAM", username);
        PamReturnValue val = new Pam(service).authenticate(username, password);
        LOG.info("Result: {}", val);
        if (PamReturnValue.PAM_SUCCESS.equals(val)) {
            return username;
        }
        return null;
View Full Code Here

      throw new AuthenticationException("No PAM services are set.");
    }

    String[] pamServices = pamServiceNames.split(",");
    for (String pamService : pamServices) {
      Pam pam = new Pam(pamService);
      boolean isAuthenticated = pam.authenticateSuccessful(user, password);
      if (!isAuthenticated) {
        throw new AuthenticationException(
          "Error authenticating with the PAM service: " + pamService);
      }
    }
View Full Code Here

      throw new AuthenticationException("No PAM services are set.");
    }

    String pamServices[] = pamServiceNames.split(",");
    for (String pamService : pamServices) {
      Pam pam = new Pam(pamService);
      boolean isAuthenticated = pam.authenticateSuccessful(user, password);
      if (!isAuthenticated) {
        throw new AuthenticationException("Error authenticating with the PAM service: " + pamService);
      }
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.jpam.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.