javax.resource.spi.security

Class PasswordCredential

Implemented Interfaces:
Serializable

public class PasswordCredential
extends Object
implements Serializable

See Also:
Serialized Form

Constructor Summary

PasswordCredential(String userName, char[] password)
Creates the credential

Method Summary

ManagedConnectionFactory
getManagedConnectionFactory()
Returns the connection factory.
char[]
getPassword()
Returns the user password.
String
getUserName()
/** Returns the user name of the principal.
void
setManagedConnectionFactory(ManagedConnectionFactory factory)
Sets the connection factory.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

PasswordCredential

public PasswordCredential(String userName,
                          char[] password)
Creates the credential
Usages and Demos :

View More Examples of PasswordCredential(String userName,char[] password)
   1:       sharedState.put("javax.security.auth.login.name", principalName);
   2:       PasswordCredential cred = new PasswordCredential(userName, password.toCharArray());
   3:       cred.setManagedConnectionFactory(getMcf());
   4:       SubjectActions.addCredentials(subject, cred);
   5:       super.loginOk = true;

View Full Code Here
   1:         subject.getPrincipals().add(new ResourcePrincipal(resourcePrincipalName));
   2:         PasswordCredential passwordCredential = new PasswordCredential(userName, password);
   3:         passwordCredential.setManagedConnectionFactory(passwordCredentialRealm.getManagedConnectionFactory());
   4:         subject.getPrivateCredentials().add(passwordCredential);
   5:         return true;

View Full Code Here
   1:         subject.getPrincipals().add(new ResourcePrincipal(resourcePrincipalName));
   2:         PasswordCredential passwordCredential = new PasswordCredential(userName, password);
   3:         passwordCredential.setManagedConnectionFactory(managedConnectionFactory);
   4:         subject.getPrivateCredentials().add(passwordCredential);
   5:         return true;

View Full Code Here
   1:       sharedState.put("javax.security.auth.login.name", userName);
   2:       PasswordCredential cred = new PasswordCredential(userName, password);
   3:       cred.setManagedConnectionFactory(getMcf());
   4:       SubjectActions.addCredentials(subject, cred);
   5:       return super.commit();

View Full Code Here
   1:          char[] decodedPassword = decode(password);
   2:          PasswordCredential cred = new PasswordCredential(username, decodedPassword);
   3:          cred.setManagedConnectionFactory(getMcf());
   4:          SubjectActions.addCredentials(subject, cred);
   5:       }

View Full Code Here

Method Details

getManagedConnectionFactory

public ManagedConnectionFactory getManagedConnectionFactory()
Returns the connection factory.
Usages and Demos :

View More Examples of getManagedConnectionFactory()
   1: import java.sql.SQLException;
   2: import javax.resource.spi.security.PasswordCredential;
   3: import com.sun.gjc.common.DataSourceObjectBuilder;
   4:         ...
   5:     protected PrintWriter logWriter;
   6:     protected PasswordCredential passwdCredential;
   7:     protected javax.resource.spi.ManagedConnectionFactory mcf = null;
   8:         ...
   9:     public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn, 
  10:         PasswordCredential passwdCred, javax.resource.spi.ManagedConnectionFactory mcf)
  11:         throws ResourceException 
  12:         ...
  13:         if(passwdCredential != null &&  
  14:             this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {

View Full Code Here

getPassword

public char[] getPassword()
Returns the user password.

getUserName

public String getUserName()
/** Returns the user name of the principal.
Usages and Demos :

View More Examples of getUserName()
   1: 
   2: import javax.resource.spi.security.PasswordCredential;
   3: 
   4:         ...
   5:         {
   6:             jc.name = ((JmsConnectionRequestInfo) info).getUserName();
   7:             jc.pwd = ((JmsConnectionRequestInfo) info).getPassword();
   8:         ...
   9:         {
  10:             PasswordCredential pwdc = GetCredentialAction.getCredential(subject, mcf);
  11:             if (pwdc == null)
  12:         ...
  13:             }
  14:             jc.name = pwdc.getUserName();

View Full Code Here
   1: import com.sun.gjc.util.SecurityUtils;
   2: import javax.resource.spi.security.PasswordCredential;
   3: import javax.resource.spi.ResourceAllocationException;
   4:         ...
   5:         }
   6:         PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
   7:         
   8:         ...
   9:         } else {
  10:             xaConn = xaDataSourceObj.getXAConnection(pc.getUserName(), 
  11:             new String(pc.getPassword()));

View Full Code Here
   1: import javax.sql.DataSource;
   2: import javax.resource.spi.security.PasswordCredential;
   3: import javax.management.MBeanServerFactory;
   4:         ...
   5:       assertTrue("Principals contains jduke", subject.getPrincipals().contains(new SimplePrincipal("jduke")));
   6:       Set creds = subject.getPrivateCredentials(PasswordCredential.class);
   7:         ...
   8:       PasswordCredential pc = (PasswordCredential) creds.iterator().next();
   9:         ...
  10:       String username = pc.getUserName();

View Full Code Here

setManagedConnectionFactory

public void setManagedConnectionFactory(ManagedConnectionFactory factory)
Sets the connection factory.
Usages and Demos :

View More Examples of setManagedConnectionFactory(ManagedConnectionFactory factory)
   1: import java.util.Map;
   2: import javax.resource.spi.security.PasswordCredential;
   3: import javax.security.auth.Subject;
   4:         ...
   5:       sharedState.put("javax.security.auth.login.name", principalName);
   6:       PasswordCredential cred = new PasswordCredential(userName, password.toCharArray());
   7:         ...
   8:       cred.setManagedConnectionFactory(getMcf());
   9:       SubjectActions.addCredentials(subject, cred);

View Full Code Here
   1: 
   2: import javax.resource.spi.security.PasswordCredential;
   3: import javax.security.auth.Subject;
   4:         ...
   5:         subject.getPrincipals().add(new ResourcePrincipal(resourcePrincipalName));
   6:         PasswordCredential passwordCredential = new PasswordCredential(userName, password);
   7:         ...
   8:         passwordCredential.setManagedConnectionFactory(passwordCredentialRealm.getManagedConnectionFactory());
   9:         subject.getPrivateCredentials().add(passwordCredential);

View Full Code Here
   1: 
   2: import javax.resource.spi.security.PasswordCredential;
   3: import javax.resource.spi.ManagedConnectionFactory;
   4:         ...
   5:         subject.getPrincipals().add(new ResourcePrincipal(resourcePrincipalName));
   6:         PasswordCredential passwordCredential = new PasswordCredential(userName, password);
   7:         ...
   8:         passwordCredential.setManagedConnectionFactory(managedConnectionFactory);
   9:         subject.getPrivateCredentials().add(passwordCredential);

View Full Code Here
   1: import java.util.Map;
   2: import javax.resource.spi.security.PasswordCredential;
   3: import javax.security.auth.Subject;
   4:         ...
   5:       sharedState.put("javax.security.auth.login.name", userName);
   6:       PasswordCredential cred = new PasswordCredential(userName, password);
   7:         ...
   8:       cred.setManagedConnectionFactory(getMcf());
   9:       SubjectActions.addCredentials(subject, cred);

View Full Code Here
   1: import java.math.BigInteger;
   2: import javax.resource.spi.security.PasswordCredential;
   3: import javax.security.auth.Subject;
   4:         ...
   5:          char[] decodedPassword = decode(password);
   6:          PasswordCredential cred = new PasswordCredential(username, decodedPassword);
   7:         ...
   8:          cred.setManagedConnectionFactory(getMcf());
   9:          SubjectActions.addCredentials(subject, cred);

View Full Code Here