Package org.apache.openejb.core.security.jaas

Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler


    public Object login(String user, String pass) throws LoginException {
        return login("OpenEJB", user, pass);
    }

    public Object login(String securityRealm, String user, String pass) throws LoginException {
        LoginContext context = ContextManager.login(securityRealm, new UsernamePasswordCallbackHandler(user, pass));

        Subject subject = context.getSubject();
        return ContextManager.getSubjectId(subject);
    }
View Full Code Here


        }
        //System.out.println("Path to login config: " + path);
    }

    public void testLogin() throws LoginException {
        LoginContext context = new LoginContext("PropertiesLogin", new UsernamePasswordCallbackHandler("jonathan", "secret"));
        context.login();

        Subject subject = context.getSubject();

        assertEquals("Should have three principals", 3, subject.getPrincipals().size());
View Full Code Here

        assertEquals("Should have zero principals", 0, subject.getPrincipals().size());
    }

    public void testBadUseridLogin() throws Exception {
        LoginContext context = new LoginContext("PropertiesLogin", new UsernamePasswordCallbackHandler("nobody", "secret"));
        try {
            context.login();
            fail("Should have thrown a FailedLoginException");
        } catch (FailedLoginException doNothing) {
        }
View Full Code Here

        }

    }

    public void testBadPWLogin() throws Exception {
        LoginContext context = new LoginContext("PropertiesLogin", new UsernamePasswordCallbackHandler("jonathan", "badpass"));
        try {
            context.login();
            fail("Should have thrown a FailedLoginException");
        } catch (FailedLoginException doNothing) {
        }
View Full Code Here

    public UUID login(String realmName, String username, String password) throws LoginException {
        if (realmName == null){
            realmName = getRealmName();
        }
        LoginContext context = new LoginContext(realmName, new UsernamePasswordCallbackHandler(username, password));
        context.login();

        Subject subject = context.getSubject();

        UUID token =  registerSubject(subject);
View Full Code Here

    public UUID login(String realmName, String username, String password) throws LoginException {
        if (realmName == null){
            realmName = getRealmName();
        }
        LoginContext context = new LoginContext(realmName, new UsernamePasswordCallbackHandler(username, password));
        context.login();

        Subject subject = context.getSubject();

        return registerSubject(subject);
View Full Code Here

public class GeronimoSecurityService implements SecurityService {
    public void init(Properties props) throws Exception {
    }

    public Object login(String user, String pass) throws LoginException {
        LoginContext context = new LoginContext("OpenEJB", new UsernamePasswordCallbackHandler(user, pass));
        context.login();

        Subject subject = context.getSubject();
        SubjectId subjectId = ContextManager.registerSubject(subject);
        return subjectId;
View Full Code Here

    public Object login(String user, String pass) throws LoginException {
        return login("OpenEJB", user, pass);
    }

    public Object login(String securityRealm, String user, String pass) throws LoginException {
        LoginContext context = ContextManager.login(securityRealm, new UsernamePasswordCallbackHandler(user, pass));

        Subject subject = context.getSubject();
        return ContextManager.getSubjectId(subject);
    }
View Full Code Here

    public Object login(String user, String pass) throws LoginException {
        return login("OpenEJB", user, pass);
    }

    public Object login(String securityRealm, String user, String pass) throws LoginException {
        LoginContext context = ContextManager.login(securityRealm, new UsernamePasswordCallbackHandler(user, pass));

        Subject subject = context.getSubject();
        return ContextManager.getSubjectId(subject);
    }
View Full Code Here

    public UUID login(String realmName, String username, String password) throws LoginException {
        if (realmName == null){
            realmName = getRealmName();
        }
        LoginContext context = new LoginContext(realmName, new UsernamePasswordCallbackHandler(username, password));
        context.login();

        Subject subject = context.getSubject();

        UUID token =  registerSubject(subject);
View Full Code Here

TOP

Related Classes of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

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.