Zum Hauptinhalt springen

Übersicht

SCIM is an HTTP-based standard for provisioning and managing identity data. Casdoor can act as a SCIM service provider so external systems can create, read, update, and delete users via SCIM.

Supported resources

Casdoor supports the User and Group resources. Manage them with these endpoints:

EndpunktMethodeBeschreibung
/scim/ServiceProviderConfigGETSupported SCIM features and resources
/scim/SchemasGETService provider schemas
/scim/ResourceTypesGETResource type metadata
/scim/Users/:idGETGet user by id
/scim/UsersGETList users (query params: startIndex, count)
/scim/UsersPOSTCreate user
/scim/Users/:idPUTReplace user
/scim/Users/:idPATCHPartial update
/scim/Users/:idDELETEDelete user
/scim/Groups/:idGETGet group by id
/scim/GroupsGETList groups (query params: startIndex, count)
/scim/GroupsPOSTCreate group
/scim/Groups/:idPUTReplace group
/scim/Groups/:idPATCHPartial update
/scim/Groups/:idDELETEDelete group

See RFC 7644 for the full SCIM spec.

User attribute mapping

SCIM User attributes map to Casdoor User fields as follows:

User Resource Schema (SCIM)User (Casdoor)
idId
meta.createdCreatedTime
meta.lastModifiedUpdatedTime
meta.versionUpdatedTime
externalIdExternalId
userNameName
passwordPassword
displayNameDisplayName
profileUrlHomepage
userTypeType
name.givenNameFirstName
name.familyNameLastName
emails[0].valueEmail
phoneNumbers[0].valuePhone
photos[0].valueAvatar
addresses[0].localityLocation
addresses[0].regionRegion
addresses[0].countryCountryCode

Da Casdoor Organisationen verwendet, um Benutzer zu verwalten, wobei jeder Benutzer einer bestimmten Organisation angehört, sollte das Attribut organization im Enterprise User Schema Extension übergeben werden (identifiziert durch den Schema-URI urn:ietf:params:scim:schemas:extension:enterprise:2.0:User). Hier ist eine Darstellung des User Resource Schema SCIM im JSON-Format:

{
"active": true,
"addresses": [
{
"country": "CN",
"locality": "Shanghai",
"region": "CN"
}
],
"displayName": "Bob~",
"emails": [
{
"value": "test1@casdoor.com"
}
],
"externalId": "1234123543234234",
"id": "ceacbcb6-40d0-48f1-af23-0990232d570a",
"meta": {
"resourceType": "User",
"created": "2023-10-08T23:51:55+08:00",
"lastModified": "2023-10-12T20:38:49+08:00",
"location": "Users/ceacbcb6-40d0-48f1-af23-0990232d570a",
"version": "2023-10-12T20:38:49+08:00"
},
"name": {
"familyName": "bob",
"formatted": "alice bob",
"givenName": "alice"
},
"nickName": "Bob~",
"phoneNumbers": [
{
"value": "18700006475"
}
],
"photos": [
{
"value": "https://cdn.casbin.org/img/casbin.svg"
}
],
"profileUrl": "https://test.com/profile/built-in/scim_test_user2",
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User",
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
],
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { // The enterprise User extension is identified using this schema URI
"organization": "built-in" // This attribute MUST be passed
},
"userName": "scim_test_user2",
"userType": "normal-user"
}