Package org.keycloak.admin.client.resource

Examples of org.keycloak.admin.client.resource.UserResource


    @Test
    public void addSocialLink() {
        createUser();

        UserResource user = realm.users().get("user1");

        SocialLinkRepresentation link = new SocialLinkRepresentation();
        link.setSocialUserId("social-user-id");
        link.setSocialUsername("social-username");

        Response response = user.addSocialLink("social-provider-id", link);
        assertEquals(204, response.getStatus());
    }
View Full Code Here


    @Test
    public void getSocialLinks() {
        addSocialLink();

        UserResource user = realm.users().get("user1");
        assertEquals(1, user.getSocialLinks().size());

        SocialLinkRepresentation link = user.getSocialLinks().get(0);
        assertEquals("social-provider-id", link.getSocialProvider());
        assertEquals("social-user-id", link.getSocialUserId());
        assertEquals("social-username", link.getSocialUsername());
    }
View Full Code Here

    @Test
    public void removeSocialLink() {
        addSocialLink();

        UserResource user = realm.users().get("user1");
        assertEquals(1, user.getSocialLinks().size());

        user.removeSocialLink("social-provider-id");

        assertEquals(0, user.getSocialLinks().size());
    }
View Full Code Here

TOP

Related Classes of org.keycloak.admin.client.resource.UserResource

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.