Package org.pac4j.http.profile

Examples of org.pac4j.http.profile.UsernameProfileCreator


    public void testClone() {
        final BasicAuthClient oldClient = new BasicAuthClient();
        oldClient.setCallbackUrl(CALLBACK_URL);
        oldClient.setName(TYPE);
        oldClient.setRealmName(REALM_NAME);
        final ProfileCreator profileCreator = new UsernameProfileCreator();
        oldClient.setProfileCreator(profileCreator);
        final UsernamePasswordAuthenticator usernamePasswordAuthenticator = new SimpleTestUsernamePasswordAuthenticator();
        oldClient.setUsernamePasswordAuthenticator(usernamePasswordAuthenticator);
        final BasicAuthClient client = (BasicAuthClient) oldClient.clone();
        assertEquals(oldClient.getCallbackUrl(), client.getCallbackUrl());
View Full Code Here


        assertEquals(oldClient.getProfileCreator(), client.getProfileCreator());
        assertEquals(oldClient.getUsernamePasswordAuthenticator(), client.getUsernamePasswordAuthenticator());
    }
   
    public void testMissingUsernamePasswordAuthenticator() {
        final BasicAuthClient basicAuthClient = new BasicAuthClient(null, new UsernameProfileCreator());
        basicAuthClient.setCallbackUrl(CALLBACK_URL);
        TestsHelper.initShouldFail(basicAuthClient, "usernamePasswordAuthenticator cannot be null");
    }
View Full Code Here

        TestsHelper.initShouldFail(basicAuthClient, "profileCreator cannot be null");
    }
   
    public void testMissingLoginUrl() {
        final BasicAuthClient basicAuthClient = new BasicAuthClient(new SimpleTestUsernamePasswordAuthenticator(),
                                                                    new UsernameProfileCreator());
        TestsHelper.initShouldFail(basicAuthClient, "callbackUrl cannot be blank");
    }
View Full Code Here

        TestsHelper.initShouldFail(basicAuthClient, "callbackUrl cannot be blank");
    }
   
    private BasicAuthClient getBasicAuthClient() {
        final BasicAuthClient basicAuthClient = new BasicAuthClient(new SimpleTestUsernamePasswordAuthenticator(),
                                                                    new UsernameProfileCreator());
        basicAuthClient.setCallbackUrl(CALLBACK_URL);
        return basicAuthClient;
    }
View Full Code Here

        final FormClient oldClient = new FormClient();
        oldClient.setCallbackUrl(CALLBACK_URL);
        oldClient.setName(TYPE);
        oldClient.setPasswordParameter(PASSWORD);
        oldClient.setUsernameParameter(USERNAME);
        final ProfileCreator profileCreator = new UsernameProfileCreator();
        oldClient.setProfileCreator(profileCreator);
        final UsernamePasswordAuthenticator usernamePasswordAuthenticator = new SimpleTestUsernamePasswordAuthenticator();
        oldClient.setUsernamePasswordAuthenticator(usernamePasswordAuthenticator);
        final FormClient client = (FormClient) oldClient.clone();
        assertEquals(oldClient.getCallbackUrl(), client.getCallbackUrl());
View Full Code Here

        assertEquals(oldClient.getProfileCreator(), client.getProfileCreator());
        assertEquals(oldClient.getUsernamePasswordAuthenticator(), client.getUsernamePasswordAuthenticator());
    }
   
    public void testMissingUsernamePasswordAuthenticator() {
        final FormClient formClient = new FormClient(LOGIN_URL, null, new UsernameProfileCreator());
        TestsHelper.initShouldFail(formClient, "usernamePasswordAuthenticator cannot be null");
    }
View Full Code Here

        TestsHelper.initShouldFail(formClient, "profileCreator cannot be null");
    }
   
    public void testMissingLoginUrl() {
        final FormClient formClient = new FormClient(null, new SimpleTestUsernamePasswordAuthenticator(),
                                                     new UsernameProfileCreator());
        TestsHelper.initShouldFail(formClient, "loginUrl cannot be blank");
    }
View Full Code Here

                                                     new UsernameProfileCreator());
        TestsHelper.initShouldFail(formClient, "loginUrl cannot be blank");
    }
   
    private FormClient getFormClient() {
        return new FormClient(LOGIN_URL, new SimpleTestUsernamePasswordAuthenticator(), new UsernameProfileCreator());
    }
View Full Code Here

TOP

Related Classes of org.pac4j.http.profile.UsernameProfileCreator

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.