Comments (4)
Indeed it seems to be an issue. We will take a closer look and fix this issue.
Thank you for you feedback !
from simpleidserver.
The issue is fixed : e7c5f61
from simpleidserver.
Hi,
The "id" attribute is mandatory and must be present in all SCIM representations for example : Users or Groups.
The class "AttributeReferenceEnricher" is used to add mandatory fields like "id", "display" or "$ref" into SCIM representations.
Those mandatory attributes are "normally" not inserted into sub complex attributes like "user\emails".
When a user is added :
POST http://localhost:60002/Users HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
Host: localhost:60002
Content-Length: 416
{
"schemas": [ "urn:ietf:params:scim:schemas:core:2.0:User", "urn:ietf:params:scim:schemas:extension:eid:2.0:User"],
"userName": "loki3",
"externalId": "externalId2",
"name": { "formatted" : "formatted", "familyName": "familyName", "givenName": "givenName" },
"phoneNumbers": [ { "type": "mobile", "value": "01" }, { "type": "home", "value": "02" } ],
"validity": "22",
"birthDate": "25-09-20 13:35:33"
}
The following result is received :
HTTP/1.1 201 Created
Date: Sun, 04 Oct 2020 16:53:21 GMT
Content-Type: application/scim+json
Server: Kestrel
Content-Length: 850
ETag: 76840920-7b48-4393-aaea-18b4678cc3bb
Location: http://localhost:60002/Users/53d7ef94-99b9-4f6b-93f2-f1ff3fb9dc70
{
"id": "53d7ef94-99b9-4f6b-93f2-f1ff3fb9dc70",
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User",
"urn:ietf:params:scim:schemas:extension:eid:2.0:User"
],
"meta": {
"resourceType": "Users",
"created": "2020-10-04T16:53:21.2108435Z",
"lastModified": "2020-10-04T16:53:21.2108436Z",
"version": "76840920-7b48-4393-aaea-18b4678cc3bb",
"location": "http://localhost:60002/Users/53d7ef94-99b9-4f6b-93f2-f1ff3fb9dc70"
},
"externalId": "externalId2",
"userName": "loki3",
"name": {
"formatted": "formatted",
"familyName": "familyName",
"givenName": "givenName"
},
"phoneNumbers": [
{
"type": "mobile",
"value": "01"
},
{
"type": "home",
"value": "02"
}
],
"validity": 22.0,
"birthDate": "2020-09-25T13:35:33"
}
When the new user is fetched :
GET http://localhost:60002/Users/53d7ef94-99b9-4f6b-93f2-f1ff3fb9dc70 HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
The following result is returned :
HTTP/1.1 200 OK
Date: Sun, 04 Oct 2020 16:53:55 GMT
Content-Type: application/scim+json
Server: Kestrel
Content-Length: 849
ETag: 76840920-7b48-4393-aaea-18b4678cc3bb
Location: http://localhost:60002/Users/53d7ef94-99b9-4f6b-93f2-f1ff3fb9dc70
{
"id": "53d7ef94-99b9-4f6b-93f2-f1ff3fb9dc70",
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User",
"urn:ietf:params:scim:schemas:extension:eid:2.0:User"
],
"meta": {
"resourceType": "Users",
"created": "2020-10-04T16:53:21.2108435",
"lastModified": "2020-10-04T16:53:21.2108436",
"version": "76840920-7b48-4393-aaea-18b4678cc3bb",
"location": "http://localhost:60002/Users/53d7ef94-99b9-4f6b-93f2-f1ff3fb9dc70"
},
"externalId": "externalId2",
"userName": "loki3",
"birthDate": "2020-09-25T13:35:33",
"phoneNumbers": [
{
"type": "home",
"value": "02"
},
{
"value": "01",
"type": "mobile"
}
],
"name": {
"givenName": "givenName",
"formatted": "formatted",
"familyName": "familyName"
},
"validity": 22.00
}
The "id" is not inserted into sub complex attributes (user\phoneNumbers).
I couldn't reproduce the error.
from simpleidserver.
I don't know about the user\phoneNumbers, but I know that for user\groups I am getting "id" instead of "value", while I am setting "value".
private IEnumerable<SCIMRepresentationAttribute> FillComplexGroupsAttribute(SCIMSchemaAttribute groupsAttribute, IEnumerable<ScimGroup> scimGroups)
{
var valueSubAttributeOfGroups = groupsAttribute.SubAttributes.Single(attr => attr.Name == ValueAttributeName);
var refSubAttributeOfGroups = groupsAttribute.SubAttributes.Single(attr => attr.Name == RefAttributeName);
var displaySubAttributeOfGroups = groupsAttribute.SubAttributes.Single(attr => attr.Name == DisplayAttributeName);
var groupsScimAttributes = new List<SCIMRepresentationAttribute>();
foreach (var group in scimGroups)
{
groupsScimAttributes.Add(new SCIMRepresentationAttribute(groupsAttribute.Id, groupsAttribute)
{
Values = new List<SCIMRepresentationAttribute>()
{
new SCIMRepresentationAttribute(valueSubAttributeOfGroups.Id,
valueSubAttributeOfGroups,
valuesString: new List<string> { group.ObjectGuid }),
new SCIMRepresentationAttribute(displaySubAttributeOfGroups.Id,
displaySubAttributeOfGroups,
valuesString: new List<string> { group.DisplayName }),
new SCIMRepresentationAttribute(refSubAttributeOfGroups.Id,
refSubAttributeOfGroups,
valuesString: new List<string> { $"{Url}/{SCIMEndpoints.Group}/{group.ObjectGuid}" }),
},
});
}
return groupsScimAttributes;
}
Imagine having IEnumerable<SCIMRepresentation>
of users with groups filled with something like this. Then, during obtaining concrete user you will get a model with "id" because it goes through your Enricher model and won't have a "value" attribute, while the model that will be returned after changing the user will return the model with "value" because it goes through CommandHandler and I am setting all the fields.
And it wouldn't be a problem, but I can't do something like this:
var valueSubAttributeOfGroups = groupsAttribute.SubAttributes.Single(attr => attr.Name == "id");
Groups attribute does not have an "id" subattribute.
from simpleidserver.
Related Issues (20)
- Doc - Explains how to add custom External Identity Provider
- Do you consider supporting webauthn technology when logging in? HOT 1
- IdServer : LDAP & INMEMORY & BULKUPLOAD
- Doc - Explains how to replace TWILIO by an another library
- IdServer - Don't use the current language to store the translation of the configuration HOT 2
- Error caused by different project startup sequences HOT 1
- Email verification error HOT 1
- Front-channel logout URL is not effective HOT 6
- Doc - Support windows authentication
- IdServer - Can synchronize AD groups
- [question]about Mobile application and One Time Password HOT 13
- Documentation - Update documentation about provisioning (SCIM an LDAP)
- [SCIM] Error in bulk insert using version 4.0.5 HOT 2
- IdServer - Support OTP authentication method
- IdServer - Explains how to use UMA2.0
- [SCIM] Performance issues version 4.0.5 HOT 13
- Broken Reference after latest pull on 16/01/24. HOT 1
- IdServer - Can enroll OTP code
- IdServer - Mobile Application - Not possible to authenticate with the QR code (RELEASE)
- [question]Problems encountered during sample execution HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simpleidserver.