Comments (8)
I tried to align my sample with the acceptance tests located in tests/SimpleIdServer.Scim.Host.Acceptance.Tests/
- I removed the route attribute from my controller
- I added the call to
e.UseStandardScimEdp("CustomResources", false);
before the call toe.UseScim()
Now I get an 404 Not Found
response when trying to call the custom resource endpoint.
from simpleidserver.
Hello :)
Your custom controller cannot be found because the function "UseStandardScimEdp" must be used before "UseScim". Otherwise, the routes "catchAllGet" and "catchAllPut" will catch all the HTTP requests.
Your code should look something like this:
o.UseStandardScimEdp("CustomResources", false);
o.UseScim(opts.EnableRealm);
from simpleidserver.
Thanks for your reply :)
That's what I tried, I placed the call configuring my custom resource before the UseScim() call.
I'll check it again tomorrow, maybe my build cache wasn't up to date.
from simpleidserver.
@simpleidserver I checked my code again, the order of the endpoints seems to be correct to me :/
I published my reproduction sample here: https://github.com/johanndev/sid-issue-762
EDIT: I included a http testing file for quickly testing the endpoints. A call to /Users works as expected, so the general setup seems to be correct.
from simpleidserver.
If I list all ActionDescriptors via:
[Route("ActionDescriptors")]
public class ActionDescriptorsController(IActionDescriptorCollectionProvider provider) : Controller
{
[HttpGet]
public IActionResult Get() {
var res = provider.ActionDescriptors.Items.Select(i => i.DisplayName);
return new OkObjectResult(res);
}
}
I get the following result:
[
"SCIM.API.ActionDescriptorsController.Get (SCIM.API)",
"SimpleIdServer.Scim.Api.BulkController.Index (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.DefaultController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.DefaultController.Put (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.DefaultController.Post (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.DefaultController.Delete (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.DefaultController.Patch (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.GetAll (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Search (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Add (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Delete (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Update (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Patch (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.ResourceTypesController.GetAll (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.ResourceTypesController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.SchemasController.GetAll (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.SchemasController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.ServiceProviderConfigController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.GetAll (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Search (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Add (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Delete (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Update (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Patch (SimpleIdServer.Scim)"
]
Notice that the CustomResourcesController
is missing, although it's registered exactly like the Users
and Groups
Controllers.
EDIT: The endpoints are correctly added to the ScimEndpointStore
:
[HttpGet("scimendpoints")]
public IActionResult Get()
{
var res = scimEndpointStore.Routes.Select(r => r.RouteName);
return new OkObjectResult(res);
}
Result:
[
"getCustomResources",
"searchCustomResources",
"getUniqueCustomResources",
"addCustomResources",
"deleteCustomResources",
"updateCustomResources",
"patchCustomResources",
"getResourceTypes",
"getResourceType",
"getSchemas",
"getSchema",
"getServiceProviderConfig",
"bulk",
"getUsers",
"searchUsers",
"getUniqueUsers",
"addUsers",
"deleteUsers",
"updateUsers",
"patchUsers",
"getGroups",
"searchGroups",
"getUniqueGroups",
"addGroups",
"deleteGroups",
"updateGroups",
"patchGroups"
]
from simpleidserver.
I made a stupid mistake creating the CustomResourcesController
: I created it directly at the bottom of the Program.cs
and subsequently used the "Move to File" Refactoring in VS. Unfortunately, VS nested the controller inside a partial program class. Removing the partial class fixes the route registration/action descriptors:
[
"SCIM.API.ActionDescriptorsController.GetActionDescriptors (SCIM.API)",
"SCIM.API.ActionDescriptorsController.Get (SCIM.API)",
"SCIM.API.CustomResourcesController.GetAll (SCIM.API)", 🥳
"SCIM.API.CustomResourcesController.Search (SCIM.API)", 🥳
"SCIM.API.CustomResourcesController.Get (SCIM.API)", 🥳
"SCIM.API.CustomResourcesController.Add (SCIM.API)" 🥳,
"SCIM.API.CustomResourcesController.Delete (SCIM.API)", 🥳
"SCIM.API.CustomResourcesController.Update (SCIM.API)", 🥳
"SCIM.API.CustomResourcesController.Patch (SCIM.API)", 🥳
"SimpleIdServer.Scim.Api.BulkController.Index (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.DefaultController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.DefaultController.Put (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.DefaultController.Post (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.DefaultController.Delete (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.DefaultController.Patch (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.GetAll (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Search (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Add (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Delete (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Update (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.GroupsController.Patch (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.ResourceTypesController.GetAll (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.ResourceTypesController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.SchemasController.GetAll (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.SchemasController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.ServiceProviderConfigController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.GetAll (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Search (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Get (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Add (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Delete (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Update (SimpleIdServer.Scim)",
"SimpleIdServer.Scim.Api.UsersController.Patch (SimpleIdServer.Scim)"
]
.... but I still get a 404
when trying to call /CustomResources
😢
from simpleidserver.
I found the error:
var customResource = SCIMSchemaBuilder.Create("urn:customresource", "CustomResources", "CustomResources")
The 's' at the end of the resource type was the culprit 🙈
Removing it and reseeding the db fixed the problem.
from simpleidserver.
Hello, and sorry for my late reply :)
I'm glad you found the issue! Don't hesitate to create GitHub tickets if you have other questions.
from simpleidserver.
Related Issues (20)
- SCIM Notification does not contains anymore user info HOT 6
- Turn off the user logout issue HOT 3
- The example fails to run HOT 12
- Update the mobile application to be compliant with EBSI
- Find the problem HOT 1
- About retrieving the password HOT 1
- Questions about some attributes. HOT 9
- Multiple login failures locked HOT 1
- EBSI conformance test - Credential Issuance - In-Time credential
- Encounter problems HOT 3
- redirect_uri error. HOT 1
- [SCIM] Proposal: Load SCIMSchema from string HOT 1
- Super administrators, realm administrators, and regular users HOT 2
- IConnectionItemsFeature Error HOT 12
- Add custom user attribute in User Schema question HOT 4
- Compliant with the EBSI - Issuer - Credential issuance
- Version 5.0.*-* missing on nuget for SimpleIdServer.IdServer.Notification.Fcm package HOT 2
- Support OPENID federation
- Performance issue on provisioning thousands of groups and their members in relational databases
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.