Examples of PasswordCredential


Examples of com.atlassian.crowd.integration.authentication.PasswordCredential

        return new UserWrapper(principal, groups);
    }

    protected void callUpdatePassword(String user, String password) throws RemoteException {
        PasswordCredential credential = new PasswordCredential();
        credential.setCredential(password);
        credential.setEncryptedCredential(false);

        SecurityServerHttpBindingStub stub = getStub();
        AuthenticatedToken token = getToken(stub);

        try {
View Full Code Here

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

            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, "passwordlm.nocreds", e.toString());
        }

        if (pwdCred==null) {
            _logger.log(Level.SEVERE, "passwordlm.nopwdcred");
            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);
        }

        if (_currentRealm == null) {
            String msg = sm.getString("pwdlm.norealmavail", realm);
            _logger.log(Level.SEVERE, msg);
            throw new LoginException(msg);
        }

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

        _username = pwdCred.getUser();
        _password = pwdCred.getPassword();

        // Delegate the actual authentication to subclass.

        authenticateUser();
        if(_logger.isLoggable(Level.FINE)){
View Full Code Here

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

      }     
    }

    // Add the PasswordCredential to the Subject
    final Subject s = subject;
    final PasswordCredential pc = new PasswordCredential(username, password, realmName);
    AppservAccessController.doPrivileged(new PrivilegedAction<Object>() {
      public Object run() {
        s.getPrivateCredentials().add(pc);
        return null;
      }
View Full Code Here

Examples of hudson.scm.SubversionSCM.DescriptorImpl.PasswordCredential

                // I don't set the cred field here, so that the 1st credential for ssh
                // won't get clobbered.
                return new SVNUserNameAuthentication(username, false);
            if (kind.equals(ISVNAuthenticationManager.PASSWORD)) {
                logWriter.println("Passing user name " + username + " and password you entered");
                cred = new PasswordCredential(username, password);
            }
            if (kind.equals(ISVNAuthenticationManager.SSH)) {
                if (keyFile == null) {
                    logWriter.println("Passing user name " + username + " and password you entered to SSH");
                    cred = new PasswordCredential(username, password);
                } else {
                    logWriter.println("Attempting a public key authentication with username " + username);
                    cred = new SshPublicKeyCredential(username, password, keyFile);
                }
            }
View Full Code Here

Examples of io.undertow.security.idm.PasswordCredential

        return identityManager;
    }

    @Override
    public boolean login(final String username, final String password) {
        final Account account = identityManager.verify(username, new PasswordCredential(password.toCharArray()));
        if (account == null) {
            return false;
        }

        authenticationComplete(account, programaticMechName, true);
View Full Code Here

Examples of io.undertow.security.idm.PasswordCredential

        return identityManager;
    }

    @Override
    public boolean login(final String username, final String password) {
        final Account account = identityManager.verify(username, new PasswordCredential(password.toCharArray()));
        if (account == null) {
            return false;
        }

        authenticationComplete(account, programaticMechName, true);
View Full Code Here

Examples of io.undertow.security.idm.PasswordCredential

                return AuthenticationMechanismOutcome.NOT_AUTHENTICATED;
            }
            final String userName = jUsername.getValue();
            final String password = jPassword.getValue();
            AuthenticationMechanismOutcome outcome = null;
            PasswordCredential credential = new PasswordCredential(password.toCharArray());
            try {
                IdentityManager identityManager = securityContext.getIdentityManager();
                Account account = identityManager.verify(userName, credential);
                if (account != null) {
                    securityContext.authenticationComplete(account, name, true);
View Full Code Here

Examples of io.undertow.security.idm.PasswordCredential

                    if (plainChallenge != null && (colonPos = plainChallenge.indexOf(COLON)) > -1) {
                        String userName = plainChallenge.substring(0, colonPos);
                        char[] password = plainChallenge.substring(colonPos + 1).toCharArray();

                        IdentityManager idm = securityContext.getIdentityManager();
                        PasswordCredential credential = new PasswordCredential(password);
                        try {
                            final AuthenticationMechanismOutcome result;
                            Account account = idm.verify(userName, credential);
                            if (account != null) {
                                securityContext.authenticationComplete(account, name, false);
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

            if (info == null) {
                return null;
            } else {
                CciConnectionRequestInfo myinfo =
                    (CciConnectionRequestInfo) info;
                PasswordCredential pc =
                    new PasswordCredential(myinfo.getUser(),
                                           myinfo.getPassword().toCharArray());
                pc.setManagedConnectionFactory(mcf);
                return pc;
            }
        } else {
            PasswordCredential pc =
            (PasswordCredential) AccessController.doPrivileged
                (new PrivilegedAction() {
                    public Object run() {
                        Set creds = subject.getPrivateCredentials
                            (PasswordCredential.class);
                        Iterator iter = creds.iterator();
                        while (iter.hasNext()) {
                            PasswordCredential temp =
                                (PasswordCredential) iter.next();
                            if (temp.getManagedConnectionFactory().
                                equals(mcf)) {
                                return temp;
                            }
                        }
                        return null;
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

        throws ResourceException {
       
        try {
            XAConnection xacon = null;
            String userName = null;
            PasswordCredential pc =
                Util.getPasswordCredential(this, subject, info);
            if (pc == null) {
                xacon = getXADataSource().getXAConnection();
            } else {
                userName = pc.getUserName();
                xacon = getXADataSource().
                    getXAConnection(userName,
                                    new String(pc.getPassword()));
            }
            Connection con = xacon.getConnection();
            return new CciManagedConnection
                (this, pc, xacon, con, true, true);
        } catch (SQLException ex) {
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.