Examples of PasswordCredential


Examples of javax.resource.spi.security.PasswordCredential

            matchManagedConnections(Set connectionSet,
                                    Subject subject,
                                    ConnectionRequestInfo info)
        throws ResourceException {

        PasswordCredential pc =
            Util.getPasswordCredential(this, subject, info);
        Iterator it = connectionSet.iterator();
        while (it.hasNext()) {
            Object obj = it.next();
            if (obj instanceof CciManagedConnection) {
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

       
        try {
            Connection con = null;
            String userName = null;
    
            PasswordCredential pc =
                Util.getPasswordCredential(this, subject, info);
            if (pc == null) {
                con = DriverManager.getConnection(url);
            } else {
                userName = pc.getUserName();
                con = DriverManager.getConnection
                    (url, userName, new String(pc.getPassword()));
            }
            return new CciManagedConnection
                (this, pc, null, con, false, true);
        } catch (SQLException ex) {
            ResourceException re =
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

            matchManagedConnections(Set connectionSet,
                                    Subject subject,
                                    ConnectionRequestInfo info)
        throws ResourceException {

        PasswordCredential pc =
            Util.getPasswordCredential(this, subject, info);
        Iterator it = connectionSet.iterator();
        while (it.hasNext()) {
            Object obj = it.next();
            if (obj instanceof CciManagedConnection) {
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

        throws ResourceException {
       
        try {
            Connection con = null;
            String userName = null;
            PasswordCredential pc =
                Util.getPasswordCredential(this, subject, info);
            if (pc == null) {
                con = DriverManager.getConnection(url);
            } else {
                userName = pc.getUserName();
                con = DriverManager.getConnection
                    (url, userName, new String(pc.getPassword()));
            }
            return new CciManagedConnection
                (this, pc, null, con, false, false);
        } catch (SQLException ex) {
            ResourceException re =
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

            matchManagedConnections(Set connectionSet,
                                    Subject subject,
                                    ConnectionRequestInfo info)
        throws ResourceException {

        PasswordCredential pc =
            Util.getPasswordCredential(this, subject, info);
        Iterator it = connectionSet.iterator();
        while (it.hasNext()) {
            Object obj = it.next();
            if (obj instanceof CciManagedConnection) {
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

    public Object getConnection(Subject subject,
                                ConnectionRequestInfo connectionRequestInfo)
        throws ResourceException {

        PasswordCredential pc =
            Util.getPasswordCredential(mcf, subject, connectionRequestInfo);
        if (!Util.isPasswordCredentialEqual(pc, passCred)) {
            throw new SecurityException("Principal does not match." +
                                        "Reauthentication not supported");
        }
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

    }
   
    try {
      if (userRole != null && rolePassword != null) {
        this.mappedRole = userRole;
        PasswordCredential cred = new PasswordCredential(userRole, decode(rolePassword));
        cred.setManagedConnectionFactory(getMcf());
        SecurityActions.addCredentials(this.subject, cred);   
      }
      return super.commit();
    } catch (Exception e) {
      throw new LoginException("Failed to decode password: "+e.getMessage()); //$NON-NLS-1$
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

        throws ResourceException {
       
        try {
            Connection con = null;
            String userName = null;
            PasswordCredential pc =
                Util.getPasswordCredential(this, subject, info);
            if (pc == null) {
                con = DriverManager.getConnection(url);
            } else {
                userName = pc.getUserName();
                con = DriverManager.getConnection
                    (url, userName, new String(pc.getPassword()));
            }
            return new JdbcManagedConnection
                (this, pc, null, con, false, false);
        } catch (SQLException ex) {
            ResourceException re =
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

            matchManagedConnections(Set connectionSet,
                                    Subject subject,
                                    ConnectionRequestInfo info)
        throws ResourceException {

        PasswordCredential pc =
            Util.getPasswordCredential(this, subject, info);
        Iterator it = connectionSet.iterator();
        while (it.hasNext()) {
            Object obj = it.next();
            if (obj instanceof JdbcManagedConnection) {
View Full Code Here

Examples of javax.resource.spi.security.PasswordCredential

            if (info == null) {
                return null;
            } else {
                JdbcConnectionRequestInfo myinfo =
                    (JdbcConnectionRequestInfo) 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
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.