You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add SCIM 2.0 Server capabilities to your Laravel application with ease. This package requires minimal configuration to get started with basic functionalities.
9
+
Add SCIM 2.0 Server capabilities to your Laravel application with ease. This package requires minimal configuration to get started with the core SCIM flows and is powering [The SCIM Playground](https://scim.dev), one of the most widely tested SCIM servers available.
10
+
11
+
## Why Laravel SCIM Server?
12
+
- Battle-tested with real-world providers through the SCIM Playground
13
+
- Familiar Laravel tooling and middleware integration
14
+
- Fully extensible configuration for resources, attributes, and filtering
15
+
- Ships with dockerized demo and an expressive test suite
11
16
12
-
This implementation is used by [The SCIM Playground](https://scim.dev) and is therefore one of the most widely tested SCIM servers available.
To quickly spin up a SCIM test server using Docker, run:
26
+
## Quick start
27
+
Spin up a SCIM test server in seconds:
16
28
17
-
~~~
29
+
```bash
18
30
docker run -d -p 8000:8000 --name laravel-scim-server ghcr.io/limosa-io/laravel-scim-server:latest
19
-
~~~
31
+
```
20
32
21
-
This command will start the server and bind it to port 8000 on your local machine. You can then access the SCIM endpoints at `http://localhost:8000/scim/v2/Users`. Other SCIM endpoints like `/Groups`, `/Schemas`, and `/ResourceTypes` will also be available.
33
+
Visit `http://localhost:8000/scim/v2/Users` (or `/Groups`, `/Schemas`, `/ResourceTypes`, etc.) to exercise the API.
Here's one way to override the default configuration without copying too much of the SCIMConfig file into your app.
74
-
~~~.php
46
+
```
47
+
48
+
## SCIM routes
49
+
50
+
| Method | Path | Description |
51
+
|--------|------|-------------|
52
+
| GET | /scim/v1 | SCIM 1.x compatibility message (returns error with upgrade guidance) |
53
+
| GET | /scim/v2 | Cross-resource index (alias of `/scim/v2/`) |
54
+
| GET | /scim/v2/ | Cross-resource index |
55
+
| POST | /scim/v2/.search | Cross-resource search across all types |
56
+
| POST | /scim/v2/Bulk | SCIM bulk operations |
57
+
| GET | /scim/v2/ResourceTypes | List available resource types |
58
+
| GET | /scim/v2/ResourceTypes/{id} | Retrieve a specific resource type |
59
+
| GET | /scim/v2/Schemas | List SCIM schemas |
60
+
| GET | /scim/v2/Schemas/{id} | Retrieve a specific schema |
61
+
| GET | /scim/v2/ServiceProviderConfig | Discover server capabilities |
62
+
| GET | /scim/v2/{resourceType} | List resources of a given type |
63
+
| POST | /scim/v2/{resourceType} | Create a new resource |
64
+
| POST | /scim/v2/{resourceType}/.search | Filter resources of a given type |
65
+
| GET | /scim/v2/{resourceType}/{resourceObject} | Retrieve a single resource |
66
+
| PUT | /scim/v2/{resourceType}/{resourceObject} | Replace a resource |
67
+
| PATCH | /scim/v2/{resourceType}/{resourceObject} | Update a resource |
68
+
| DELETE | /scim/v2/{resourceType}/{resourceObject} | Delete a resource |
69
+
70
+
Optional "Me" routes can be enabled separately:
71
+
72
+
| Method | Path | Description |
73
+
|--------|------|-------------|
74
+
| GET | /scim/v2/Me | Retrieve the SCIM resource for the authenticated subject |
75
+
| PUT | /scim/v2/Me | Replace the SCIM resource for the authenticated subject |
76
+
| POST | /scim/v2/Me | Create the authenticated subject (requires `RouteProvider::meRoutePost()`) |
77
+
78
+
## Configuration
79
+
80
+
The package resolves configuration via `SCIMConfig::class`. Extend it to tweak resource definitions, attribute mappings, filters, or pagination defaults.
81
+
82
+
Register your custom config in `app/Providers/AppServiceProvider.php`:
class YourCustomSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig
@@ -80,59 +99,61 @@ class YourCustomSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig
80
99
{
81
100
$config = parent::getUserConfig();
82
101
83
-
// Modify the $config variable however you need...
102
+
// Customize $config as needed.
84
103
85
104
return $config;
86
105
}
87
106
}
88
-
~~~
89
-
90
-
91
-
# Security & App Integration
92
-
93
-
By default, this package does no security checks on its own. This can be dangerous, in that a functioning SCIM Server can view, add, update, delete, or list users.
94
-
You are welcome to implement your own security checks at the middleware layer,
95
-
or somehow/somewhere else that makes sense for your application. But make sure to do **something**.
96
-
97
-
If you want to integrate into _already existing_ middleware, you'll want to take the following steps -
107
+
```
98
108
99
-
## Turn off automatic publishing of routes
109
+
### Pagination settings
110
+
Cursor-based pagination is enabled by default via the [SCIM cursor pagination draft](https://datatracker.ietf.org/doc/draft-ietf-scim-cursor-pagination/). Publish the config file and update `config/scim.php` to adjust defaults:
100
111
101
-
Modify `config/scim.php` like this:
102
112
```php
103
-
<?php
104
-
return [
105
-
"publish_routes" => false
106
-
];
113
+
'pagination' => [
114
+
'defaultPageSize' => 10,
115
+
'maxPageSize' => 100,
116
+
'cursorPaginationEnabled' => false,
117
+
]
107
118
```
108
119
109
-
## Next, explicitly publish your routes with your choice of middleware
110
-
111
-
In either your RouteServiceProvider, or in a particular route file, add the following:
120
+
## Security & app integration
121
+
SCIM grants the ability to view, add, update, and delete users or groups. Make sure you secure the routes before shipping to production.
112
122
113
-
```php
114
-
use ArieTimmerman\Laravel\SCIMServer\RouteProvider as SCIMServerRouteProvider;
123
+
1. Disable automatic route publishing if you plan to wrap routes in your own middleware:
115
124
116
-
SCIMServerRouteProvider::publicRoutes(); // Make sure to add public routes *first*
125
+
```php
126
+
// config/scim.php
127
+
return [
128
+
'publish_routes' => false,
129
+
];
130
+
```
117
131
132
+
2. Re-register the routes with your preferred middleware stack:
118
133
119
-
Route::middleware('auth:api')->group(function () { // or any other middleware you choose
120
-
SCIMServerRouteProvider::routes(
121
-
[
122
-
'public_routes' => false // but do not hide public routes (metadata) behind authentication
123
-
]
124
-
);
134
+
```php
135
+
use ArieTimmerman\Laravel\SCIMServer\RouteProvider as SCIMServerRouteProvider;
0 commit comments