Giter Site home page Giter Site logo

scim2-jersey's Introduction

SCIM 2 Jersey example

This is a simple example that demonstrates the basics of writing a SCIM 2 service using the SCIM 2 SDK and Jersey (JAX-RS).

For more example code, it may be helpful to look at the unit tests for the scim2-sdk-server component. For general usage information on the SCIM 2 SDK, visit the SCIM 2 SDK wiki.

Running this example

Build using standard Maven goals: E.g., mvn compile or mvn package

To run with Jetty: mvn jetty:run

SCIM 2 endpoints

By default, the base URL for SCIM 2 requests is http://localhost:8888/scim2, and the following endpoints are available:

  • http://localhost:8888/scim2/ServiceProviderConfig
  • http://localhost:8888/scim2/Schemas
  • http://localhost:8888/scim2/ResourceTypes
  • http://localhost:8888/scim2/Users

The Users endpoint provides two example users with the IDs 123 and ABC. These user resources are simply loaded on the fly from memory. A real-world SCIM 2 service would retrieve the user data from a data source such as an RDBMS or directory server, of course.

Customizing the base URL

To change the HTTP port, change the httpConnector.port value for the org.eclipse.jetty build plugin in the POM.

To change base path, change the servlet-mapping.url-pattern value in web.xml.

Overview of how this works

To create your own SCIM 2 server, you first need to add the com.unboundid.product.scim2.scim2-sdk-server dependency to a JAX-RS application.

(If you're looking for general information about working with JAX-RS, the Restful Java with JAX-RS gitbook is a good place to start.)

You can then use the scim2-sdk-server classes to set up your SCIM 2 server's capabilities:

  • Provide ServiceProviderConfig endpoint by providing an implementation of AbstractServiceProviderConfigEndpoint. See the ServiceProviderConfigEndpoint class for an example.
  • For any resource types that you need to implement (i.e., users), provide a standard JAX-RS service class and annotate it with @ResourceType. See the UsersEndpoint class for an example.
  • Register your server's endpoints, filters, exception mappers, and JSON serialization/deserialization provider by providing an implementation of ResourceConfig. See Scim2Application for an example.

scim2-jersey's People

Contributors

braveulysses avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.