org.keycloak.services.resources.admin

## Class UserFederationResource

- java.lang.Object
- - org.keycloak.services.resources.admin.UserFederationResource

-     public class UserFederationResource
      extends Object

  Base resource for managing users
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected RealmAuth` | `auth`
    `protected static org.jboss.logging.Logger` | `logger`
    `protected RealmModel` | `realm`
    `protected KeycloakSession` | `session`
    `protected javax.ws.rs.core.UriInfo` | `uriInfo`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserFederationResource(RealmModel realm, RealmAuth auth)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.ws.rs.core.Response` | `createProviderInstance(UserFederationProviderRepresentation rep)` Create a provider
    `void` | `deleteProviderInstance(String id)` Delete a provider
    `UserFederationProviderFactoryRepresentation` | `getProvider(String id)` Get List of available provider factories
    `UserFederationProviderRepresentation` | `getProviderInstance(String id)` get a provider
    `List<UserFederationProviderFactoryRepresentation>` | `getProviders()` Get List of available provider factories
    `List<UserFederationProviderRepresentation>` | `getUserFederationInstances()` list configured providers
    `javax.ws.rs.core.Response` | `syncUsers(String providerId, String action)` trigger sync of users
    `void` | `updateProviderInstance(String id, UserFederationProviderRepresentation rep)` Update a provider

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

    - #### realm

          protected RealmModel realm

    - #### auth

          protected RealmAuth auth

    - #### uriInfo

          @Context
          protected javax.ws.rs.core.UriInfo uriInfo

    - #### session

          @Context
          protected KeycloakSession session

  - ### Constructor Detail

    - #### UserFederationResource

          public UserFederationResource(RealmModel realm,
                                RealmAuth auth)

  - ### Method Detail

    - #### getProviders

          @GET
          @Path(value="providers")
          @Produces(value="application/json")
          public List<UserFederationProviderFactoryRepresentation> getProviders()

      Get List of available provider factories
      Returns:

    - #### getProvider

          @GET
          @Path(value="providers/{id}")
          @Produces(value="application/json")
          public UserFederationProviderFactoryRepresentation getProvider(@PathParam(value="id")
                                                                                  String id)

      Get List of available provider factories
      Returns:

    - #### createProviderInstance

          @POST
          @Path(value="instances")
          @Consumes(value="application/json")
          public javax.ws.rs.core.Response createProviderInstance(UserFederationProviderRepresentation rep)

      Create a provider
      Parameters:
        `rep` -
      Returns:

    - #### updateProviderInstance

          @PUT
          @Path(value="instances/{id}")
          @Consumes(value="application/json")
          public void updateProviderInstance(@PathParam(value="id")
                                                      String id,
                                                      UserFederationProviderRepresentation rep)

      Update a provider
      Parameters:
        `id` -
        `rep` -

    - #### getProviderInstance

          @GET
          @Path(value="instances/{id}")
          @Produces(value="application/json")
          public UserFederationProviderRepresentation getProviderInstance(@PathParam(value="id")
                                                                                   String id)

      get a provider
      Parameters:
        `id` -

    - #### deleteProviderInstance

          @DELETE
          @Path(value="instances/{id}")
          public void deleteProviderInstance(@PathParam(value="id")
                                                String id)

      Delete a provider
      Parameters:
        `id` -

    - #### getUserFederationInstances

          @GET
          @Path(value="instances")
          @Produces(value="application/json")
          public List<UserFederationProviderRepresentation> getUserFederationInstances()

      list configured providers
      Returns:

    - #### syncUsers

          @GET
          @Path(value="sync/{id}")
          public javax.ws.rs.core.Response syncUsers(@PathParam(value="id")
                                                     String providerId,
                                                     @QueryParam(value="action")
                                                     String action)

      trigger sync of users
      Returns:

Copyright © 2014. All Rights Reserved.