Replies: 1 comment 9 replies
-
@uncvrd Thanks for reporting this. Let me check, I think we only allow getting a record by email and not userName. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi again! Been looking in to integrating Directory Sync and ran in to an issue testing SCIM with Okta...
I ran through the tutorial guide in the documentation and did the following:
The user was inserted in to my application and jackson_store
The user was marked as
active: false
in jackson_store per the Okta docs, and was removed from my application correctly. So far so good.This is where things get weird... It looks like Okta (or Boxy) first initiates a GET
search()
to find any existing users in jackson_index with a db filter set touserName = [USERNAME]
which should find my existing user but instead returns an empty list.Which then means Okta (or Boxy) sends a POST request to create a new user. However I get a 409 "User already exists" error since the user was already in my database of course...but the search failed to find my user causing the POST to run.
What I discovered in the source code was that when Boxy first inserts a user it creates a unique hash using a combined value separated by a colon of
directoryId:email
that is used in jackson_store/index key column likedsync:users:1:foundry:b67e40ffad3c33ea2eee36c686124f0159c32707
...BUT thesearch()
listed above queries ondirectoryId:userName
. So my key instead looks like thisdsync:users:1:foundry:3942666b062c6ac16e2142c5fd24a5b4101a3d80
Which means that if youruserName
andemail
are different then when that search is run to find existing users it will fail since the hash digest will be different.So my question is, do these properties need to be the same value to work or should the create/search methods be updated to query/create a digest on the same property?
I don't know if I hit an edge case using Okta because when I registered for an account it created a user that I've been testing with that has a different userName than email.
Here's where the digest is generated from the email when creating a user
jackson/npm/src/directory-sync/scim/Users.ts
Line 51 in 8bba503
Here is where the digest is generated from the userName when searching for a user
jackson/npm/src/directory-sync/scim/DirectoryUsers.ts
Line 148 in 8bba503
Which is used when we have a request that looks like:
Hopefully this question makes sense, let me know if I can provide any more information!
Beta Was this translation helpful? Give feedback.
All reactions