limosa-io / laravel-scim-server

SCIM 2.0 Server implementation for Laravel
MIT License
50 stars 28 forks source link

Allow Okta-style PUT on users to update Enterprise attributes #36

Closed uberbrady closed 1 year ago

uberbrady commented 1 year ago

It turns out that when Okta updates user attributes, it does so with a PUT to the User object to replace all of the attributes. That seems to generally work, however, when you try to update any of the Enterprise-namespaced attributes, the updates will silently be ignored.

I think (but I am definitely not sure!) it's because the arguments we pass to Flatten aren't including all of the namespaces. This change should fix that - but I'm open to other approaches if there are better ways to go about it.

Thanks again for this lovely software - and if it turns out that you don't need this PR or don't want to take it, no worries - you can close it, and it won't hurt my feelings.

arietimmerman commented 1 year ago

Thanks for this pull request. I think I get the idea, but let me do a little testing first.

arietimmerman commented 1 year ago

@uberbrady Can it be that your config is wrong? For the resource type you are replacing you should have defined schemas properly. Can it be that the schemas from your PUT request do not match the schemas from your configuration?

To clarify, I mean this config setting.

arietimmerman commented 1 year ago

I struggled myself a bit to get this working, but turned out the configuration is just quite confusing.

I fixed this in #37. This fix allows you to remove the 'schemas' definition from the mapping and define 'schema' only for the resource type. There you should include the enterprise-schema.

See https://github.com/arietimmerman/laravel-scim-server/blob/master/src/SCIMConfig.php#L44

uberbrady commented 1 year ago

Thank you so much for doing this! I'll try to take a stab at pulling down your latest and making the appropriate changes on our side.