Package com.sun.enterprise.security.auth.login.common

Examples of com.sun.enterprise.security.auth.login.common.PasswordCredential


    {
    _logger.log(Level.FINE,"Constructing a PasswordCredential from client authentication token");
        /* create a GSSUPToken from the authentication token */
        GSSUPToken tok  = GSSUPToken.getServerSideInstance(orb, codec, authtok);

        final PasswordCredential pwdcred = tok.getPwdcred();
        final SecurityContext fsc = sc;
      if(_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"Password credential = " + pwdcred.toString());
    _logger.log(Level.FINE,"Adding PasswordCredential to subject's PrivateCredentials");
  }
        java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
            public java.lang.Object run() {
                fsc.subject.getPrivateCredentials().add(pwdcred);
View Full Code Here


            _logger.log(Level.FINE,"\t\t[ClientPasswordLoginModule] " +
                        "added PrincipalImpl to Subject");
           
      String realm = DEFAULT_REALMNAME;

      PasswordCredential pc =
    new PasswordCredential(username, password, realm);
      if(!subject.getPrivateCredentials().contains(pc)) {
    subject.getPrivateCredentials().add(pc);
            }
      // in any case, clean out state
      username = null;
View Full Code Here

            String msg = sm.getString("pwdlm.noinfo");
            _logger.log(Level.SEVERE, msg);
            throw new LoginException(msg);
        }

        PasswordCredential pwdCred = null;

        try {
            Iterator i = _subject.getPrivateCredentials().iterator();
            while (i.hasNext() && pwdCred == null) {
                Object privCred = i.next();
                if (privCred instanceof PasswordCredential) {
                    pwdCred = (PasswordCredential) privCred;
                }
            }
        } catch (Exception e) {
            _logger.log(Level.WARNING, SecurityLoggerInfo.privateSubjectCredentialsError, e.toString());
        }

        if (pwdCred == null) {
            _logger.log(Level.SEVERE, SecurityLoggerInfo.noPwdCredentialProvidedError);
            String msg = sm.getString("pwdlm.nocreds");
            throw new LoginException(msg);
        }

        // Need to obtain the requested realm to get parameters.

        String realm = null;
        try {
            realm = pwdCred.getRealm();
            _currentRealm = Realm.getInstance(realm);

        } catch (Exception e) {
            String msg = sm.getString("pwdlm.norealm", realm);
            _logger.log(Level.SEVERE, msg);
            throw new LoginException(msg);
        }

         // Get username and password data from credential (ignore callback)

        setUsername(pwdCred.getUser());
        setPasswordChar(pwdCred.getPassword());
        setPassword(new String(pwdCred.getPassword()));
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.security.auth.login.common.PasswordCredential

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.