Package org.teiid.security

Examples of org.teiid.security.Credentials


        String applicationName = connProps.getProperty(TeiidURL.CONNECTION.APP_NAME);
        // user may be null if using trustedToken to log on
        String user = connProps.getProperty(TeiidURL.CONNECTION.USER_NAME, CoreConstants.DEFAULT_ANON_USERNAME);
        // password may be null if using trustedToken to log on
        String password = connProps.getProperty(TeiidURL.CONNECTION.PASSWORD);
    Credentials credential = null;
        if (password != null) {
            credential = new Credentials(password.toCharArray());
        }
       
        boolean adminConnection = Boolean.parseBoolean(connProps.getProperty(TeiidURL.CONNECTION.ADMIN));
    try {
      SessionMetadata sessionInfo = service.createSession(user,credential, applicationName, connProps, adminConnection, true);
View Full Code Here


      
    public void testAuthenticate() throws Exception {
        TeiidLoginContext ms = createMembershipService();
        List<String> domains = new ArrayList<String>();
        domains.add("testFile"); //$NON-NLS-1$
        ms.authenticateUser("user1", new Credentials("pass1".toCharArray()), null, domains, false); //$NON-NLS-1$ //$NON-NLS-2$
       
        Mockito.verify(ms.getLoginContext()).login();
       
        assertEquals("user1@testFile", ms.getUserName()); //$NON-NLS-1$
    }
View Full Code Here

    public void testPassThrough() throws Exception {
        TeiidLoginContext ms = createMembershipService();
        List<String> domains = new ArrayList<String>();
        domains.add("passthrough"); //$NON-NLS-1$
        ms.authenticateUser("user1", new Credentials("pass1".toCharArray()), null, domains, true); //$NON-NLS-1$ //$NON-NLS-2$
       
        assertEquals("alreadylogged@passthrough", ms.getUserName()); //$NON-NLS-1$
    }
View Full Code Here

TOP

Related Classes of org.teiid.security.Credentials

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.